-
Notifications
You must be signed in to change notification settings - Fork 267
feat: add ARM64 support for AgentENV #86
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 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -99,9 +99,20 @@ jobs: | |||||||||||||||||||
| path: dist/${{ matrix.asset_name }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| build-server: | ||||||||||||||||||||
| name: Build server (linux-x86_64) | ||||||||||||||||||||
| name: Build server (linux-${{ matrix.arch }}) | ||||||||||||||||||||
| needs: validate-version | ||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||
| strategy: | ||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||
| matrix: | ||||||||||||||||||||
| include: | ||||||||||||||||||||
| - os: ubuntu-24.04 | ||||||||||||||||||||
| arch: x86_64 | ||||||||||||||||||||
| modes: kvm pvm | ||||||||||||||||||||
| - os: ubuntu-24.04-arm | ||||||||||||||||||||
| arch: aarch64 | ||||||||||||||||||||
| modes: kvm | ||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
@@ -124,7 +135,7 @@ jobs: | |||||||||||||||||||
| run: | | ||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||
|
|
||||||||||||||||||||
| for MODE in kvm pvm; do | ||||||||||||||||||||
| for MODE in ${{ matrix.modes }}; do | ||||||||||||||||||||
| BUNDLE="dist/bundle-$MODE" | ||||||||||||||||||||
| mkdir -p "$BUNDLE/ublk" | ||||||||||||||||||||
| cp target/release/server "$BUNDLE/server" | ||||||||||||||||||||
|
|
@@ -163,18 +174,17 @@ jobs: | |||||||||||||||||||
| mkdir -p "$BUNDLE/etc/overlaybd" | ||||||||||||||||||||
| cp "$STAGE_DEPS/overlaybd/etc/overlaybd/overlaybd.json" "$BUNDLE/etc/overlaybd/overlaybd.json" | ||||||||||||||||||||
| rm -rf "$STAGE_HOME" | ||||||||||||||||||||
| if [[ "$MODE" == "kvm" ]]; then | ||||||||||||||||||||
| ARCHIVE="dist/aenv-server-linux-x86_64.tar.gz" | ||||||||||||||||||||
| else | ||||||||||||||||||||
| ARCHIVE="dist/aenv-server-linux-x86_64-pvm.tar.gz" | ||||||||||||||||||||
| ARCHIVE="dist/aenv-server-linux-${{ matrix.arch }}.tar.gz" | ||||||||||||||||||||
| if [[ "$MODE" == "pvm" ]]; then | ||||||||||||||||||||
| ARCHIVE="dist/aenv-server-linux-${{ matrix.arch }}-pvm.tar.gz" | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| tar -czf "$ARCHIVE" -C "$BUNDLE" . | ||||||||||||||||||||
| done | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - uses: actions/upload-artifact@v7 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| name: server-bundles | ||||||||||||||||||||
| path: dist/aenv-server-linux-x86_64*.tar.gz | ||||||||||||||||||||
| name: server-bundles-${{ matrix.arch }} | ||||||||||||||||||||
| path: dist/aenv-server-linux-${{ matrix.arch }}*.tar.gz | ||||||||||||||||||||
|
|
||||||||||||||||||||
| release: | ||||||||||||||||||||
| name: Create GitHub Release | ||||||||||||||||||||
|
|
@@ -215,32 +225,36 @@ jobs: | |||||||||||||||||||
| dist/aenv-darwin-aarch64 | ||||||||||||||||||||
| dist/aenv-server-linux-x86_64-pvm.tar.gz | ||||||||||||||||||||
| dist/aenv-server-linux-x86_64.tar.gz | ||||||||||||||||||||
| dist/aenv-server-linux-aarch64.tar.gz | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - uses: actions/upload-artifact@v7 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| name: dist | ||||||||||||||||||||
| path: dist/ | ||||||||||||||||||||
|
|
||||||||||||||||||||
| docker-publish: | ||||||||||||||||||||
| name: Build and push Docker image (${{ matrix.mode }}) | ||||||||||||||||||||
| docker-publish-kvm-images: | ||||||||||||||||||||
| name: Build KVM Docker image (${{ matrix.arch }}) | ||||||||||||||||||||
| needs: release | ||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||
| strategy: | ||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||
| matrix: | ||||||||||||||||||||
| include: | ||||||||||||||||||||
| - mode: kvm | ||||||||||||||||||||
| version_suffix: "" | ||||||||||||||||||||
| - mode: pvm | ||||||||||||||||||||
| version_suffix: "-pvm" | ||||||||||||||||||||
| - os: ubuntu-24.04 | ||||||||||||||||||||
| arch: amd64 | ||||||||||||||||||||
| platform: linux/amd64 | ||||||||||||||||||||
| - os: ubuntu-24.04-arm | ||||||||||||||||||||
| arch: arm64 | ||||||||||||||||||||
| platform: linux/arm64 | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
| packages: write | ||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set lowercase owner | ||||||||||||||||||||
| run: echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV | ||||||||||||||||||||
| run: echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_ENV" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||||
| uses: docker/setup-buildx-action@v4 | ||||||||||||||||||||
|
|
@@ -257,10 +271,84 @@ jobs: | |||||||||||||||||||
| with: | ||||||||||||||||||||
| context: . | ||||||||||||||||||||
| file: deploy/docker/Dockerfile.agentenv | ||||||||||||||||||||
| platforms: ${{ matrix.platform }} | ||||||||||||||||||||
| push: true | ||||||||||||||||||||
|
Comment on lines
+274
to
275
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. [performance · medium] Suggestion:
Suggested change
Comment on lines
+274
to
275
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. [performance · medium] |
||||||||||||||||||||
| build-args: | | ||||||||||||||||||||
| AENV_VIRTUALIZATION_MODE=kvm | ||||||||||||||||||||
| tags: | | ||||||||||||||||||||
| ghcr.io/${{ env.OWNER }}/aenv-server:${{ github.ref_name }}-${{ matrix.arch }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| docker-publish-kvm-manifest: | ||||||||||||||||||||
| name: Publish multi-architecture KVM Docker image | ||||||||||||||||||||
| needs: docker-publish-kvm-images | ||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| packages: write | ||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Set lowercase owner | ||||||||||||||||||||
|
Comment on lines
+285
to
+289
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. [security · low] Suggestion:
Suggested change
|
||||||||||||||||||||
| run: echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_ENV" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||||
| uses: docker/setup-buildx-action@v4 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Log in to GHCR | ||||||||||||||||||||
| uses: docker/login-action@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| registry: ghcr.io | ||||||||||||||||||||
| username: ${{ github.actor }} | ||||||||||||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Create multi-architecture manifest | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||
| image="ghcr.io/${OWNER}/aenv-server" | ||||||||||||||||||||
| version="${GITHUB_REF_NAME}" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| docker buildx imagetools create \ | ||||||||||||||||||||
| --tag "${image}:${version}" \ | ||||||||||||||||||||
| --tag "${image}:latest" \ | ||||||||||||||||||||
|
Comment on lines
+309
to
+310
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. [bug · low] Suggestion:
Suggested change
Comment on lines
+309
to
+310
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. [bug · medium] |
||||||||||||||||||||
| "${image}:${version}-amd64" \ | ||||||||||||||||||||
| "${image}:${version}-arm64" | ||||||||||||||||||||
|
Comment on lines
+309
to
+312
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. [other · low]
Comment on lines
+308
to
+312
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. [other · medium] |
||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Inspect published image | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| docker buildx imagetools inspect \ | ||||||||||||||||||||
| "ghcr.io/${OWNER}/aenv-server:${GITHUB_REF_NAME}" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| docker-publish-pvm: | ||||||||||||||||||||
| name: Build and push PVM Docker image (amd64) | ||||||||||||||||||||
| needs: release | ||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
| packages: write | ||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set lowercase owner | ||||||||||||||||||||
| run: echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_ENV" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||||
| uses: docker/setup-buildx-action@v4 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Log in to GHCR | ||||||||||||||||||||
| uses: docker/login-action@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| registry: ghcr.io | ||||||||||||||||||||
| username: ${{ github.actor }} | ||||||||||||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build and push PVM image | ||||||||||||||||||||
| uses: docker/build-push-action@v7 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| context: . | ||||||||||||||||||||
| file: deploy/docker/Dockerfile.agentenv | ||||||||||||||||||||
| platforms: linux/amd64 | ||||||||||||||||||||
| push: true | ||||||||||||||||||||
|
Comment on lines
+343
to
349
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. [other · medium] |
||||||||||||||||||||
| cache-from: type=gha,scope=agentenv-runtime | ||||||||||||||||||||
| build-args: | | ||||||||||||||||||||
| AENV_VIRTUALIZATION_MODE=${{ matrix.mode }} | ||||||||||||||||||||
| AENV_VIRTUALIZATION_MODE=pvm | ||||||||||||||||||||
| tags: | | ||||||||||||||||||||
| ghcr.io/${{ env.OWNER }}/aenv-server:${{ github.ref_name }}${{ matrix.version_suffix }} | ||||||||||||||||||||
| ghcr.io/${{ env.OWNER }}/aenv-server:latest${{ matrix.version_suffix }} | ||||||||||||||||||||
| ghcr.io/${{ env.OWNER }}/aenv-server:${{ github.ref_name }}-pvm | ||||||||||||||||||||
| ghcr.io/${{ env.OWNER }}/aenv-server:latest-pvm | ||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[security · high]
This newly added publishing job runs Docker-maintained third-party actions by mutable tags while holding
packages: write; the following login action also receivesGITHUB_TOKEN. If either tag is retargeted or compromised, its code can steal the token or publish a tampered manifest. Pin bothdocker/setup-buildx-actionanddocker/login-actionin this job to audited full commit SHAs.