Skip to content

Commit 8026bb5

Browse files
committed
Initial commit with RabbitMQ support
1 parent ae43f4c commit 8026bb5

39 files changed

+2710
-0
lines changed

.editorconfig

Lines changed: 297 additions & 0 deletions
Large diffs are not rendered by default.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
### Description
11+
A clear and concise description of what the bug is.
12+
13+
### Steps to reproduce
14+
Please share a clear and concise description of the problem.
15+
1. Go to '...'
16+
2. Install '....'
17+
3. Run commands '....'
18+
...
19+
20+
### Expected behavior
21+
A clear and concise description of what you expected to happen.
22+
23+
### Actual behavior
24+
A clear and concise description of what actually happened.
25+
26+
### Configuration
27+
28+
* MONAI Deploy Messaging Library version/commit:
29+
* OS and version (distro if applicable):
30+
* Kubernetes version (if applicable):
31+
* Docker version (if applicable):
32+
* Installation source (NGC, Dockerhub, or something else):
33+
* Hardware configuration (CPU, GPU, memory, storage, etc...):
34+
* Application & version (e.g. Informatics Gateway, 0.1.0):
35+
36+
### Regression?
37+
Did this work in the previous build or release of the MONAI Deploy Messaging Library? If you can try a previous release or build to find out, that can help us narrow down the problem. If you don't know, that's OK.
38+
39+
### Other information
40+
(Please attach any logs available and remember to anonymize any PHI before sharing).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
SPDX-FileCopyrightText: © 2021-2022 MONAI Consortium
3+
SPDX-License-Identifier: Apache License 2.0
4+
-->
5+
6+
Fixes # .
7+
8+
### Description
9+
A few sentences describing the changes proposed in this pull request.
10+
11+
### Status
12+
**Ready/Work in progress/Hold**
13+
14+
### Types of changes
15+
<!--- Put an `x` in all the boxes that apply, and remove the not applicable items -->
16+
- [ ] Non-breaking change (fix or new feature that would not break existing functionality).
17+
- [ ] Breaking change (fix or new feature that would cause existing functionality to change).
18+
- [ ] New tests added to cover the changes.
19+
- [ ] All tests passed locally by running `./src/run-tests-in-docker.sh`.
20+
- [ ] [Documentation comments](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments) included/updated.
21+
- [ ] User guide updated.
22+
- [ ] I have updated the changelog

.github/workflows/ci.yml

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
# SPDX-FileCopyrightText: © 2022 MONAI Consortium
2+
# SPDX-License-Identifier: Apache License 2.0
3+
4+
name: ci
5+
6+
on:
7+
# Triggers on pushes and on pull requests
8+
push:
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
env:
14+
BUILD_CONFIG: "Release"
15+
SOLUTION: "Monai.Deploy.Messaging.sln"
16+
TEST_RESULTS: "results/"
17+
18+
jobs:
19+
20+
analyze:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
actions: read
24+
contents: read
25+
security-events: write
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
language: [ 'csharp' ]
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v2
34+
with:
35+
fetch-depth: 0
36+
- uses: actions/setup-dotnet@v1
37+
with:
38+
dotnet-version: "6.0.x"
39+
40+
- name: Enable NuGet cache
41+
uses: actions/[email protected]
42+
with:
43+
path: ~/.nuget/packages
44+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
45+
restore-keys: |
46+
${{ runner.os }}-nuget
47+
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v1
50+
with:
51+
languages: ${{ matrix.language }}
52+
53+
- name: Restore dependencies
54+
run: dotnet restore
55+
working-directory: ./src
56+
57+
- name: Build Solution
58+
run: dotnet build -c ${{ env.BUILD_CONFIG }} --nologo ${{ env.SOLUTION }}
59+
working-directory: ./src
60+
61+
- name: Perform CodeQL Analysis
62+
uses: github/codeql-action/analyze@v1
63+
64+
- name: Secret detection
65+
uses: zricethezav/gitleaks-action@master
66+
67+
unit-test:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Set up JDK 11
71+
uses: actions/setup-java@v1
72+
with:
73+
java-version: 1.11
74+
75+
- uses: actions/setup-dotnet@v1
76+
with:
77+
dotnet-version: "6.0.x"
78+
79+
- name: Enable NuGet cache
80+
uses: actions/[email protected]
81+
with:
82+
path: ~/.nuget/packages
83+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
84+
restore-keys: |
85+
${{ runner.os }}-nuget
86+
87+
- uses: actions/checkout@v2
88+
with:
89+
fetch-depth: 0
90+
91+
- name: Install SonarCloud scanner
92+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
93+
run: dotnet tool install --global dotnet-sonarscanner
94+
95+
- name: Restore dependencies
96+
run: dotnet restore
97+
working-directory: ./src
98+
99+
- name: Begin SonarScanner
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
103+
run: dotnet sonarscanner begin /k:"Project-MONAI_monai-deploy-messaging" /o:"project-monai" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="${{ env.TEST_RESULTS }}/**/*.xml"
104+
working-directory: ./src
105+
106+
- name: Build
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
110+
run: dotnet build -c ${{ env.BUILD_CONFIG }} --nologo "${{ env.SOLUTION }}"
111+
working-directory: ./src
112+
113+
- name: Test
114+
env:
115+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
117+
run: find ~+ -type f -name "*.Test.csproj" | xargs -L1 dotnet test -c ${{ env.BUILD_CONFIG }} -v=minimal -r "${{ env.TEST_RESULTS }}" --collect:"XPlat Code Coverage" --settings coverlet.runsettings
118+
working-directory: ./src
119+
120+
- name: End SonarScanner
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
124+
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
125+
working-directory: ./src
126+
127+
- uses: codecov/codecov-action@v2
128+
with:
129+
token: ${{ secrets.CODECOV_TOKEN }}
130+
directory: "src/${{ env.TEST_RESULTS }}"
131+
files: "**/coverage.opencover.xml"
132+
flags: unittests
133+
name: codecov-umbrella
134+
fail_ci_if_error: true
135+
verbose: true
136+
137+
build:
138+
runs-on: ${{ matrix.os }}
139+
140+
outputs:
141+
majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
142+
143+
strategy:
144+
matrix:
145+
os: [ubuntu-latest, windows-latest]
146+
fail-fast: true
147+
148+
permissions:
149+
contents: write
150+
packages: write
151+
checks: write
152+
security-events: write
153+
154+
steps:
155+
- name: Checkout repository
156+
uses: actions/checkout@v2
157+
with:
158+
fetch-depth: 0
159+
160+
- uses: actions/setup-dotnet@v1
161+
with:
162+
dotnet-version: "6.0.x"
163+
164+
- name: Enable NuGet cache
165+
uses: actions/[email protected]
166+
with:
167+
path: ~/.nuget/packages
168+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
169+
restore-keys: |
170+
${{ runner.os }}-nuget
171+
172+
- name: Restore dependencies
173+
run: dotnet restore
174+
working-directory: ./src
175+
176+
- name: Install GitVersion
177+
run: dotnet tool install --global GitVersion.Tool
178+
179+
- name: Determine Version
180+
id: gitversion
181+
uses: gittools/actions/gitversion/[email protected]
182+
with:
183+
useConfigFile: true
184+
updateAssemblyInfo: true
185+
updateAssemblyInfoFilename: src/AssemblyInfo.cs
186+
187+
- name: Build Solution
188+
run: dotnet build -c ${{ env.BUILD_CONFIG }} --nologo ${{ env.SOLUTION }}
189+
working-directory: ./src
190+
191+
- name: Package
192+
env:
193+
PACKAGEDIR: '${{ github.workspace }}/release/'
194+
if: ${{ matrix.os == 'ubuntu-latest' }}
195+
run: |
196+
mkdir $PACKAGEDIR
197+
dotnet pack --no-build -c ${{ env.BUILD_CONFIG }} -o $PACKAGEDIR -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
198+
ls -lR $PACKAGEDIR
199+
working-directory: ./src
200+
201+
- name: Upload
202+
if: ${{ matrix.os == 'ubuntu-latest' }}
203+
uses: actions/[email protected]
204+
with:
205+
path: ${{ github.workspace }}/release/*.nupkg
206+
retention-days: 30
207+
208+
publish:
209+
runs-on: ubuntu-latest
210+
needs: [build, unit-test]
211+
steps:
212+
- uses: actions/download-artifact@v2
213+
id: download
214+
215+
- name: List artifacts
216+
run: ls -ldR ${{steps.download.outputs.download-path}}/**/*
217+
218+
- uses: actions/setup-dotnet@v1
219+
env:
220+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
221+
with:
222+
dotnet-version: "6.0.x"
223+
source-url: https://nuget.pkg.github.com/Project-MONAI/index.json
224+
225+
- name: Publish to GitHub
226+
run: dotnet nuget push ${{ steps.download.outputs.download-path }}/artifact/*.nupkg
227+
228+
release:
229+
if: ${{ contains(github.ref, 'refs/heads/main') ||contains(github.head_ref, 'release/') }}
230+
runs-on: ubuntu-latest
231+
needs: [build, unit-test]
232+
env:
233+
MAJORMINORPATCH: ${{ needs.build.outputs.majorMinorPatch }}
234+
235+
steps:
236+
- uses: actions/checkout@v2
237+
with:
238+
fetch-depth: 0
239+
240+
- uses: actions/download-artifact@v2
241+
id: download
242+
243+
- name: List artifacts
244+
run: ls -ldR ${{steps.download.outputs.download-path}}/**/*
245+
246+
- name: Publish to NuGet.org
247+
run: dotnet nuget push release/*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET }} --skip-duplicate
248+
249+
- name: Extract owner and repo
250+
uses: jungwinter/split@v1
251+
id: repo
252+
with:
253+
seperator: "/"
254+
msg: ${{ github.repository }}
255+
256+
- name: Install GitReleaseManager
257+
uses: gittools/actions/gitreleasemanager/[email protected]
258+
with:
259+
versionSpec: "0.13.x"
260+
261+
- name: Create release with GitReleaseManager
262+
uses: gittools/actions/gitreleasemanager/[email protected]
263+
with:
264+
token: ${{ secrets.GITHUB_TOKEN }}
265+
owner: ${{ steps.repo.outputs._0 }}
266+
repository: ${{ steps.repo.outputs._1 }}
267+
milestone: ${{ env.MAJORMINORPATCH }}
268+
name: Release v${{ env.MAJORMINORPATCH }}
269+
270+
- name: Publish release with GitReleaseManager
271+
uses: gittools/actions/gitreleasemanager/[email protected]
272+
if: ${{ contains(github.ref, 'refs/heads/main') }}
273+
with:
274+
token: ${{ secrets.GITHUB_TOKEN }}
275+
owner: ${{ steps.repo.outputs._0 }}
276+
repository: ${{ steps.repo.outputs._1 }}
277+
tagName: ${{ env.MAJORMINORPATCH }}
278+
279+
- name: Close release with GitReleaseManager
280+
uses: gittools/actions/gitreleasemanager/[email protected]
281+
if: ${{ contains(github.ref, 'refs/heads/main') }}
282+
with:
283+
token: ${{ secrets.GITHUB_TOKEN }}
284+
owner: ${{ steps.repo.outputs._0 }}
285+
repository: ${{ steps.repo.outputs._1 }}
286+
milestone: ${{ env.MAJORMINORPATCH }}

0 commit comments

Comments
 (0)