Skip to content

Commit aefd4a6

Browse files
Merge pull request #301 from petabridge/dev
v1.7.1 Release
2 parents 76d60c4 + 812d3e4 commit aefd4a6

17 files changed

+205
-253
lines changed

.dockerignore

-3
This file was deleted.

README.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,33 @@ If you do need to make an update to Lighthouse, here are some cases where that m
1515
The easiest way to run Lighthouse is via [Petabridge's official Lighthouse Docker images on Docker Hub](https://hub.docker.com/r/petabridge/lighthouse):
1616

1717

18-
**Linux Images**
18+
### Linux Images
19+
20+
#### AMD64
21+
22+
```
23+
docker pull petabridge/lighthouse:latest
24+
```
25+
26+
or
27+
1928
```
2029
docker pull petabridge/lighthouse:linux-latest
2130
```
2231

23-
**Windows Images**
32+
#### ARM64
33+
34+
```
35+
docker pull petabridge/lighthouse:arm64-latest
36+
```
37+
38+
### Windows Images
39+
2440
```
2541
docker pull petabridge/lighthouse:windows-latest
2642
```
2743

28-
All of these images run lighthouse on top of .NET Core 2.1 and expose the Akka.Cluster TCP endpoint on port 4053 by default. These images also come with [`Petabridge.Cmd.Host` installed](https://cmd.petabridge.com/articles/install/host-configuration.html) and exposed on TCP port 9110.
44+
All of these images run lighthouse on top of .NET 6 and expose the Akka.Cluster TCP endpoint on port 4053 by default. These images also come with [`Petabridge.Cmd.Host` installed](https://cmd.petabridge.com/articles/install/host-configuration.html) and exposed on TCP port 9110.
2945

3046
> Linux images also come with [the `pbm` client](https://cmd.petabridge.com/articles/install/index.html) installed as a global .NET Core tool, so you can remotely execute `pbm` commands inside the containers themselves without exposing `Petabridge.Cmd.Host` over the network.
3147
>

RELEASE_NOTES.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#### 1.6.2 June 27 2022 ####
1+
#### 1.7.1 October 24 2022 ####
22

3-
* [Bumped Akka.NET version to 1.4.39](https://github.com/akkadotnet/akka.net/releases/tag/1.4.39)
4-
* [Bumped Akka.Hosting from 0.2.2 to 0.3.4](https://github.com/petabridge/lighthouse/pull/266).
3+
* [Bumped Akka.NET version to 1.4.45](https://github.com/akkadotnet/akka.net/releases/tag/1.4.45)
4+
* [Bumped Akka.Hosting to 0.5.1](https://github.com/akkadotnet/Akka.Hosting/releases/tag/0.5.1).
5+
* [Upgraded to Petabridge.Cmd 1.1.3](https://cmd.petabridge.com/articles/RELEASE_NOTES.html) and used Akka.Hosting support;

build-system/azure-pipeline.template.yaml

+8-16
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ jobs:
1616
clean: false # whether to fetch clean each time
1717
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
1818
persistCredentials: true
19+
- task: UseDotNet@2
20+
displayName: 'Use .NET 6 SDK 6.0.100'
21+
inputs:
22+
version: 6.0.100
1923
# Linux or macOS
24+
- script: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
25+
displayName: Docker - Register QEMU
26+
continueOnError: true
27+
condition: in( variables['Agent.OS'], 'Linux', 'Darwin' )
2028
- task: Bash@3
2129
displayName: Linux / OSX Build
2230
inputs:
@@ -38,22 +46,6 @@ jobs:
3846
testResultsFiles: '**/*.trx' #TestResults folder usually
3947
testRunTitle: ${{ parameters.name }}
4048
mergeTestResults: true
41-
#Docker build
42-
# Build on Linux
43-
- task: Bash@3
44-
displayName: Docker Build (Linux)
45-
inputs:
46-
filePath: ${{ parameters.scriptFileName }}
47-
arguments: ${{ parameters.dockerBuildArgs }}
48-
continueOnError: false
49-
condition: in( variables['Agent.OS'], 'Linux', 'Darwin' )
50-
- task: BatchScript@1
51-
displayName: Docker Build (Windows)
52-
inputs:
53-
filename: ${{ parameters.scriptFileName }}
54-
arguments: ${{ parameters.dockerBuildArgs }}
55-
continueOnError: true
56-
condition: eq( variables['Agent.OS'], 'Windows_NT' )
5749
- script: 'echo 1>&2'
5850
failOnStderr: true
5951
displayName: 'If above is partially succeeded, then fail'

build-system/linux-pr-validation.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ jobs:
2020
vmImage: 'ubuntu-20.04'
2121
scriptFileName: ./build.sh
2222
scriptArgs: all
23+
- template: azure-pipeline.template.yaml
24+
parameters:
25+
name: LinuxRuntimesTests
26+
vmImage: 'ubuntu-20.04'
27+
scriptFileName: ./build.sh
28+
scriptArgs: RunTestsOnRuntimes

build-system/windows-release.yaml

+28-16
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ variables:
1818
jobs:
1919
- job: publishNetCore
2020
pool:
21-
vmImage: windows-2019
21+
vmImage: windows-latest
2222
demands: Cmd
2323
steps:
24+
- task: UseDotNet@2
25+
displayName: 'Use .NET 6 SDK 6.0.100'
26+
inputs:
27+
version: 6.0.100
2428
- task: BatchScript@1
2529
displayName: 'dotnet publish'
2630
inputs:
@@ -29,8 +33,8 @@ jobs:
2933
- task: CopyFiles@2
3034
displayName: 'Copy dotnet publish Output'
3135
inputs:
32-
sourceFolder: src/Lighthouse/bin/Release/netcoreapp3.1/publish/
33-
targetFolder: $(Build.ArtifactStagingDirectory)/bin/Release/netcoreapp3.1/publish/
36+
sourceFolder: src/Lighthouse/bin/Release/net6.0/publish/
37+
targetFolder: $(Build.ArtifactStagingDirectory)/bin/Release/net6.0/publish/
3438
- task: CopyFiles@2
3539
displayName: 'Copy Dockerfiles'
3640
inputs:
@@ -61,33 +65,41 @@ jobs:
6165
buildType: 'current'
6266
downloadType: 'single'
6367
artifactName: 'drop'
64-
itemPattern: drop/**
6568
downloadPath: '$(Agent.BuildDirectory)'
69+
- task: CopyFiles@2
70+
displayName: 'Copy into PWD'
71+
inputs:
72+
sourceFolder: $(Agent.BuildDirectory)/drop
73+
targetFolder: $(Agent.BuildDirectory)
74+
# needed for ARM builds
6675
- task: Docker@2
6776
displayName: "Login to Docker Hub"
6877
inputs:
6978
command: login
7079
containerRegistry: $(dockerConnectionName)
71-
- task: Docker@2
72-
displayName: Docker Build (Linux)
73-
inputs:
74-
command: buildAndPush
75-
Dockerfile: $(Agent.BuildDirectory)/drop/Dockerfile-linux
76-
repository: petabridge/lighthouse
77-
tags: |
78-
latest
79-
linux-latest
80-
$(Build.SourceBranchName)
81-
$(Build.SourceBranchName)-linux
80+
- script: docker build --no-cache -f Dockerfile-linux -t petabridge/lighthouse:latest -t petabridge/lighthouse:linux-latest -t petabridge/lighthouse:$(Build.SourceBranchName) -t petabridge/lighthouse:$(Build.SourceBranchName)-linux .
81+
displayName: Docker Build (AMD64)
82+
workingDirectory: $(Agent.BuildDirectory)
83+
- script: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
84+
displayName: Docker - Register QEMU
85+
- script: docker buildx build --platform linux/arm64 -f Dockerfile-arm64 --no-cache -t petabridge/lighthouse:arm64-latest -t petabridge/lighthouse:$(Build.SourceBranchName)-arm64 .
86+
displayName: Docker Build (ARM64)
87+
workingDirectory: $(Agent.BuildDirectory)
88+
- script: docker push -a petabridge/lighthouse
89+
displayName: Docker Push
8290
- task: Docker@2
8391
displayName: Logout of Docker Hub
8492
inputs:
8593
command: logout
8694
containerRegistry: $(dockerConnectionName)
95+
- script: 'echo 1>&2'
96+
failOnStderr: true
97+
displayName: 'If above is partially succeeded, then fail'
98+
condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues')
8799

88100
- job: windowsImageDeploy
89101
pool:
90-
vmImage: windows-2019
102+
vmImage: windows-latest
91103
dependsOn: publishNetCore
92104
steps:
93105
- task: DownloadBuildArtifacts@0

build.fsx

+41-95
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,17 @@ let toolsDir = __SOURCE_DIRECTORY__ @@ "tools"
3737
let output = __SOURCE_DIRECTORY__ @@ "bin"
3838
let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults"
3939
let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults"
40+
let dockerScriptDir = __SOURCE_DIRECTORY__ @@ "src" @@ "Lighthouse"
4041
let outputNuGet = output @@ "nuget"
4142

4243
exception ConnectionFailure of string
4344

45+
let composedGetDirName (p:string) =
46+
System.IO.Path.GetDirectoryName p
47+
48+
let composedGetFileNameWithoutExtension (p:string) =
49+
System.IO.Path.GetFileNameWithoutExtension p
50+
4451
Target "Clean" (fun _ ->
4552
ActivateFinalTarget "KillCreatedProcesses"
4653

@@ -131,24 +138,24 @@ Target "NBench" <| fun _ ->
131138

132139
projects |> Seq.iter runSingleProject
133140

141+
let dockerFilesWithTags =
142+
match (isWindows) with
143+
| true -> [("src/Lighthouse/Dockerfile-windows", ["windows-latest"])]
144+
| _ -> [("src/Lighthouse/Dockerfile-linux", ["latest";"linux-latest"]); ("src/Lighthouse/Dockerfile-arm64", ["arm64-latest"])]
145+
134146
Target "RunTestsOnRuntimes" (fun _ ->
135147

136148
let LighthouseConnectTimeout = 20.0 // in seconds
137-
138-
let dockerFileForTest =
139-
match (isWindows) with
140-
| true -> "src/Lighthouse/Dockerfile-windows"
141-
| _ -> "src/Lighthouse/Dockerfile-linux"
142149

143150
let installPbm () =
144151
// Install pbm client to test connections
145152
ExecProcess(fun info ->
146153
info.FileName <- "dotnet"
147154
info.Arguments <- "tool install --global pbm") (TimeSpan.FromMinutes 5.0) |> ignore // this is fine if tool is already installed
148155

149-
let startLighthouseDocker dockerFile =
150-
printfn "Starting Lighthouse..."
151-
let runArgs = "run -d --name lighthouse --hostname lighthouse1 -p 4053:4053 -p 9110:9110 --env CLUSTER_IP=127.0.0.1 --env CLUSTER_SEEDS=akka.tcp://some@lighthouse1:4053 --env CLUSTER_PORT=4053 lighthouse:latest"
156+
let startLighthouseDocker dockerFile tag =
157+
printfn "Starting Lighthouse w/ Dockerfile %s" dockerFile
158+
let runArgs = sprintf "run -d --name lighthouse --hostname lighthouse1 -p 4053:4053 -p 9110:9110 --env ACTORSYSTEM=some --env CLUSTER_IP=127.0.0.1 --env CLUSTER_SEEDS=akka.tcp://some@127.0.0.1:4053 --env CLUSTER_PORT=4053 lighthouse:%s" tag
152159
let runResult = ExecProcess(fun info ->
153160
info.FileName <- "docker"
154161
info.WorkingDirectory <- (Directory.GetParent dockerFile).FullName
@@ -162,7 +169,7 @@ Target "RunTestsOnRuntimes" (fun _ ->
162169
info.WorkingDirectory <- (Directory.GetParent dockerFile).FullName
163170
info.Arguments <- "rm -f lighthouse") (System.TimeSpan.FromMinutes 5.0) |> ignore // cleanup failure should not fail the test
164171

165-
let startLighhouseLocally exePath =
172+
let startLighthouseLocally exePath =
166173
printfn "Starting Lighthouse locally..."
167174
try
168175
let runResult = ExecProcess(fun info ->
@@ -184,21 +191,15 @@ Target "RunTestsOnRuntimes" (fun _ ->
184191
| _ -> printfn "Lighthouse was connected successfully"
185192

186193
installPbm()
187-
startLighthouseDocker dockerFileForTest
188-
try
189-
connectLighthouse()
190-
finally
191-
stopLighthouseDocker dockerFileForTest
192-
193-
// Test Full .NET Framework version under windows only
194-
// TODO: To make this work, need to start lighthouse and pbm as two parallel processes
195-
(*
196-
match (isWindows) with
197-
| true ->
198-
startLighhouseLocally "src/Lighthouse/bin/Release/net461/Lighthouse.exe"
199-
connectLighthouse()
200-
| _ -> ()
201-
*)
194+
195+
let runSpec (dockerFile, tags) =
196+
startLighthouseDocker dockerFile (tags |> List.head)
197+
try
198+
connectLighthouse()
199+
finally
200+
stopLighthouseDocker dockerFile
201+
202+
dockerFilesWithTags |> Seq.iter runSpec
202203
)
203204

204205

@@ -243,7 +244,7 @@ Target "SignPackages" (fun _ ->
243244
info.FileName <- signPath
244245
info.WorkingDirectory <- __SOURCE_DIRECTORY__
245246
info.Arguments <- args) (System.TimeSpan.FromMinutes 5.0) (* Reasonably long-running task. *)
246-
if result <> 0 then failwithf "SignClient failed.%s" args
247+
if result <> 0 then failwithf "SignClient failed. %s" args
247248

248249
assemblies |> Seq.iter (signAssembly)
249250
else
@@ -315,7 +316,7 @@ Target "PublishCode" (fun _ ->
315316
Project = project
316317
Configuration = configuration
317318
VersionSuffix = overrideVersionSuffix project
318-
Framework = "netcoreapp3.1"
319+
Framework = "net6.0"
319320
})
320321

321322
projects |> Seq.iter (runSingleProject)
@@ -326,74 +327,19 @@ let mapDockerImageName (projectName:string) =
326327
| "Lighthouse" -> Some("lighthouse")
327328
| _ -> None
328329

329-
let composedGetDirName (p:string) =
330-
System.IO.Path.GetDirectoryName p
331-
332-
let composedGetFileNameWithoutExtension (p:string) =
333-
System.IO.Path.GetFileNameWithoutExtension p
334-
335330
Target "BuildDockerImages" (fun _ ->
336-
let projects = !! "src/**/*.csproj"
337-
-- "src/**/*Tests.csproj" // Don't publish unit tests
338-
-- "src/**/*Tests*.csproj"
339-
340-
let dockerFile =
341-
match (isWindows) with
342-
| true -> "Dockerfile-windows"
343-
| _ -> "Dockerfile-linux"
344-
345-
let dockerTags (imageName:string, assemblyVersion:string) =
346-
match(isWindows) with
347-
| true -> [| imageName + ":" + releaseNotes.AssemblyVersion; imageName + ":" + releaseNotes.AssemblyVersion + "-nanoserver1803"; imageName + ":latest" |]
348-
| _ -> [| imageName + ":" + releaseNotes.AssemblyVersion; imageName + ":" + releaseNotes.AssemblyVersion + "-linux"; imageName + ":latest" |]
349-
350-
351-
let remoteRegistryUrl = getBuildParamOrDefault "remoteRegistry" ""
352-
353-
let buildDockerImage imageName projectPath =
354-
355-
let args =
356-
if(hasBuildParam "remoteRegistry") then
357-
StringBuilder()
358-
|> append "build"
359-
|> append "-f"
360-
|> append dockerFile
361-
|> append "-t"
362-
|> append (imageName + ":" + releaseNotes.AssemblyVersion)
363-
|> append "-t"
364-
|> append (imageName + ":latest")
365-
|> append "-t"
366-
|> append (remoteRegistryUrl + "/" + imageName + ":" + releaseNotes.AssemblyVersion)
367-
|> append "-t"
368-
|> append (remoteRegistryUrl + "/" + imageName + ":latest")
369-
|> append "."
370-
|> toText
371-
else
372-
StringBuilder()
373-
|> append "build"
374-
|> append "-f"
375-
|> append dockerFile
376-
|> append "-t"
377-
|> append (imageName + ":" + releaseNotes.AssemblyVersion)
378-
|> append "-t"
379-
|> append (imageName + ":latest")
380-
|> append "."
381-
|> toText
382-
383-
ExecProcess(fun info ->
384-
info.FileName <- "docker"
385-
info.WorkingDirectory <- composedGetDirName projectPath
386-
info.Arguments <- args) (System.TimeSpan.FromMinutes 5.0) (* Reasonably long-running task. *)
387-
388-
let runSingleProject project =
389-
let projectName = composedGetFileNameWithoutExtension project
390-
let imageName = mapDockerImageName projectName
391-
let result = match imageName with
392-
| None -> 0
393-
| Some(name) -> buildDockerImage name project
394-
if result <> 0 then failwithf "docker build failed. %s" project
395-
396-
projects |> Seq.iter (runSingleProject)
331+
if(isWindows) then
332+
let result = ExecProcess(fun info ->
333+
info.FileName <- "powershell"
334+
info.WorkingDirectory <- dockerScriptDir
335+
info.Arguments <- sprintf " ./buildWindowsDockerImages.ps1 -tagVersion %s" releaseNotes.AssemblyVersion) (System.TimeSpan.FromMinutes 5.0) (* Reasonably long-running task. *)
336+
if result <> 0 then failwithf "Unable to build Lighthouse Dockerfiles"
337+
else
338+
let result = ExecProcess(fun info ->
339+
info.FileName <- "sh"
340+
info.WorkingDirectory <- dockerScriptDir
341+
info.Arguments <- sprintf " ./buildLinuxDockerImages.sh %s" releaseNotes.AssemblyVersion) (System.TimeSpan.FromMinutes 5.0) (* Reasonably long-running task. *)
342+
if result <> 0 then failwithf "Unable to build Lighthouse Dockerfiles"
397343
)
398344

399345
//--------------------------------------------------------------------------------
@@ -460,7 +406,7 @@ Target "Nuget" DoNothing
460406

461407
// tests dependencies
462408
"Build" ==> "RunTests"
463-
"PublishCode" ==> "BuildDockerImages" ==> "RunTestsOnRuntimes"
409+
"BuildDockerImages" ==> "RunTestsOnRuntimes"
464410

465411
// nuget dependencies
466412
"Clean" ==> "Build" ==> "CreateNuget"
@@ -470,7 +416,7 @@ Target "Nuget" DoNothing
470416
"Clean" ==> "BuildRelease" ==> "Docfx"
471417

472418
// Docker
473-
"BuildRelease" ==> "PublishCode" ==> "BuildDockerImages" ==> "Docker"
419+
"BuildDockerImages" ==> "Docker"
474420

475421
// all
476422
"BuildRelease" ==> "All"

0 commit comments

Comments
 (0)