-
Notifications
You must be signed in to change notification settings - Fork 42
Update GitHub Actions workflows to use 'beta-latest' tag for images and add new workflows for releasing dashboard and Python SDK #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Publish Dashboard image to GHCR and Deploy to K8s | ||
NiveditJain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ${{ github.repository_owner }}/exosphere-dashboard | ||
| SHA_TAG: ${{ github.sha }} | ||
|
|
||
NiveditJain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| jobs: | ||
| publish-image: | ||
| runs-on: ubuntu-latest | ||
|
|
||
NiveditJain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| outputs: | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| json: ${{ steps.meta.outputs.json }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Generate tags & labels | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=raw,value=latest | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=semver,pattern={{major}} | ||
| type=sha,format=short | ||
|
|
||
NiveditJain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ./dashboard | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,113 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| name: Publish State Manager image to GHCR and Deploy to K8s | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||
| - 'state-manager/**' | ||||||||||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||||||||||
| types: [published] | ||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
NiveditJain marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||
| REGISTRY: ghcr.io | ||||||||||||||||||||||||||||||||||||||||||||||
| IMAGE_NAME: ${{ github.repository_owner }}/exosphere-state-manager | ||||||||||||||||||||||||||||||||||||||||||||||
| SHA_TAG: ${{ github.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Optional: add concurrency to avoid parallel publishes of the same release. env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/exosphere-state-manager
SHA_TAG: ${{ github.sha }}
+concurrency:
+ group: release-state-manager-${{ github.event.release.tag_name || github.run_id }}
+ cancel-in-progress: true📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||||||||||||||||||||||||
| mongodb: | ||||||||||||||||||||||||||||||||||||||||||||||
| image: mongo:7 | ||||||||||||||||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||||||||||||||||
| - 27017:27017 | ||||||||||||||||||||||||||||||||||||||||||||||
| options: >- | ||||||||||||||||||||||||||||||||||||||||||||||
| --health-cmd "mongosh --eval 'db.runCommand(\"ping\")'" | ||||||||||||||||||||||||||||||||||||||||||||||
| --health-interval 10s | ||||||||||||||||||||||||||||||||||||||||||||||
| --health-timeout 5s | ||||||||||||||||||||||||||||||||||||||||||||||
| --health-retries 5 | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+22
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Harden MongoDB health check for reliability. Ensure the command exists on the container and returns non-zero on failure; add options: >-
- --health-cmd "mongosh --eval 'db.runCommand(\"ping\")'"
+ --health-cmd "mongosh --quiet --eval 'db.adminCommand({ ping: 1 })'"
--health-interval 10s
--health-timeout 5s
--health-retries 5If your base image lacks 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v5 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| python-version: '3.12' | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install uv | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: astral-sh/setup-uv@v2 | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dev dependencies with uv | ||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: state-manager | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| uv sync --group dev | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run unit tests with pytest and coverage | ||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: state-manager | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| uv run pytest tests/unit/ --cov=app --cov-report=xml --cov-report=term-missing -v --junitxml=pytest-report.xml | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload coverage reports to Codecov | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: codecov/codecov-action@v5 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| token: ${{ secrets.CODECOV_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||
| slug: exospherehost/exospherehost | ||||||||||||||||||||||||||||||||||||||||||||||
| files: state-manager/coverage.xml | ||||||||||||||||||||||||||||||||||||||||||||||
| flags: state-manager-unittests | ||||||||||||||||||||||||||||||||||||||||||||||
| name: state-manager-coverage-report | ||||||||||||||||||||||||||||||||||||||||||||||
| fail_ci_if_error: true | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload test results | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| name: state-manager-test-results | ||||||||||||||||||||||||||||||||||||||||||||||
| path: state-manager/pytest-report.xml | ||||||||||||||||||||||||||||||||||||||||||||||
| retention-days: 30 | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| publish-image: | ||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||
| needs: test | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||
| packages: write | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+75
to
+78
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Trailing whitespace. YAML linters (and your static analysis) flag trailing spaces on Line 78. Remove them. permissions:
contents: read
- packages: write
+ packages: write📝 Committable suggestion
Suggested change
🧰 Tools🪛 YAMLlint (1.37.1)[error] 78-78: trailing spaces (trailing-spaces) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| outputs: | ||||||||||||||||||||||||||||||||||||||||||||||
| tags: ${{ steps.meta.outputs.tags }} | ||||||||||||||||||||||||||||||||||||||||||||||
| json: ${{ steps.meta.outputs.json }} | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - uses: docker/setup-buildx-action@v3 | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Log in to GHCR | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: docker/login-action@v3 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| registry: ${{ env.REGISTRY }} | ||||||||||||||||||||||||||||||||||||||||||||||
| username: ${{ github.actor }} | ||||||||||||||||||||||||||||||||||||||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Generate tags & labels | ||||||||||||||||||||||||||||||||||||||||||||||
| id: meta | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: docker/metadata-action@v5 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||||||||||||||||||||||||||||||||||||||||||||||
| tags: | | ||||||||||||||||||||||||||||||||||||||||||||||
| type=raw,value=latest | ||||||||||||||||||||||||||||||||||||||||||||||
| type=semver,pattern={{version}} | ||||||||||||||||||||||||||||||||||||||||||||||
| type=semver,pattern={{major}}.{{minor}} | ||||||||||||||||||||||||||||||||||||||||||||||
| type=semver,pattern={{major}} | ||||||||||||||||||||||||||||||||||||||||||||||
| type=sha,format=short | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+95
to
+106
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Semver tags won’t be created on release events unless you pass the release tag to metadata-action. Inject tags: |
type=raw,value=latest
- type=semver,pattern={{version}}
- type=semver,pattern={{major}}.{{minor}}
- type=semver,pattern={{major}}
+ type=semver,pattern={{version}},value=${{ github.event.release.tag_name }}
+ type=semver,pattern={{major}}.{{minor}},value=${{ github.event.release.tag_name }}
+ type=semver,pattern={{major}},value=${{ github.event.release.tag_name }}
type=sha,format=short📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build and push | ||||||||||||||||||||||||||||||||||||||||||||||
| uses: docker/build-push-action@v5 | ||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||
| context: ./state-manager | ||||||||||||||||||||||||||||||||||||||||||||||
| push: true | ||||||||||||||||||||||||||||||||||||||||||||||
| tags: ${{ steps.meta.outputs.tags }} | ||||||||||||||||||||||||||||||||||||||||||||||
| labels: ${{ steps.meta.outputs.labels }} | ||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.