-
Notifications
You must be signed in to change notification settings - Fork 0
migrating to github #1
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
Open
davezuckerman
wants to merge
7
commits into
main
Choose a base branch
from
AP-489-migrate-to-github
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7f3a84a
migrating to github
39a6631
workflow changes for docker buildx
3a8e09c
fixed mistake in build.yml
ea886e3
Added setup step for buildx in build.yml
937d709
more changes for buildx in release and build
0744f88
more build changes for buildx
34bf885
build and release fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,219 @@ | ||
| name: Build / Test / Push | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| BUILD_SUFFIX: -build-${{ github.run_id }}_${{ github.run_attempt }} | ||
| DOCKER_METADATA_SET_OUTPUT_ENV: 'true' | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.runner }} | ||
| outputs: | ||
| build-image-arm: ${{ steps.gen-output.outputs.image-arm64 }} | ||
| build-image-x64: ${{ steps.gen-output.outputs.image-x64 }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - platform: linux/amd64 | ||
| runner: ubuntu-24.04 | ||
| - platform: linux/arm64 | ||
| runner: ubuntu-24.04-arm | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - id: build-meta | ||
| name: Produce the build image tag | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| tags: type=sha,suffix=${{ env.BUILD_SUFFIX }} | ||
|
|
||
| # Build cache is shared among all builds of the same architecture | ||
| - id: cache-meta | ||
| name: Fetch build cache metadata | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| tags: type=raw,value=buildcache-${{ runner.arch }} | ||
|
|
||
| - id: get-registry | ||
| name: Get the sanitized registry name | ||
| run: | | ||
| echo "registry=$(echo '${{ steps.build-meta.outputs.tags }}' | cut -f1 -d:)" | tee -a "$GITHUB_OUTPUT" | ||
|
|
||
| - id: set_build_url | ||
| name: Set BUILD_URL | ||
| run: | | ||
| echo "build_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | tee -a "$GITHUB_OUTPUT" | ||
|
|
||
| - id: build | ||
| name: Build/push the arch-specific image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| platforms: ${{ matrix.platform }} | ||
| build-args: | | ||
| BUILD_TIMESTAMP=${{ github.event.repository.updated_at }} | ||
| BUILD_URL=${{ steps.set_build_url.outputs.build_url }} | ||
| GIT_REF_NAME=${{ github.ref_name }} | ||
| GIT_SHA=${{ github.sha }} | ||
| GIT_REPOSITORY_URL=${{ github.repositoryUrl }} | ||
| cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }} | ||
| cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max | ||
| labels: ${{ steps.build-meta.outputs.labels }} | ||
| provenance: mode=max | ||
| sbom: true | ||
| tags: ${{ steps.get-registry.outputs.registry }} | ||
| outputs: type=image,push-by-digest=true,push=true | ||
|
|
||
| - id: gen-output | ||
| name: Write arch-specific image digest to outputs | ||
| run: | | ||
| echo "image-${RUNNER_ARCH,,}=${{ steps.get-registry.outputs.registry }}@${{ steps.build.outputs.digest }}" | tee -a "$GITHUB_OUTPUT" | ||
|
|
||
| merge: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - build | ||
| env: | ||
| DOCKER_APP_IMAGE_ARM64: ${{ needs.build.outputs.build-image-arm }} | ||
| DOCKER_APP_IMAGE_X64: ${{ needs.build.outputs.build-image-x64 }} | ||
| outputs: | ||
| build-image: ${{ steps.meta.outputs.tags }} | ||
| build-image-arm: ${{ needs.build.outputs.build-image-arm }} | ||
| build-image-x64: ${{ needs.build.outputs.build-image-x64 }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| tags: | | ||
| type=sha,suffix=-build-${{ github.run_id }}_${{ github.run_attempt }} | ||
|
|
||
| - name: Push the multi-platform image | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| --tag "$DOCKER_METADATA_OUTPUT_TAGS" \ | ||
| "$DOCKER_APP_IMAGE_ARM64" "$DOCKER_APP_IMAGE_X64" | ||
|
|
||
| test: | ||
| runs-on: ubuntu-24.04 | ||
| needs: | ||
| - merge | ||
| env: | ||
| COMPOSE_FILE: docker-compose.yml:docker-compose.ci.yml | ||
| DOCKER_APP_IMAGE: ${{ needs.merge.outputs.build-image }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Compose | ||
| uses: docker/setup-compose-action@v1 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Setup the stack | ||
| run: | | ||
| docker compose build --quiet | ||
| docker compose pull --quiet | ||
| docker compose up --wait | ||
| docker compose exec -u root app chown -R alma:alma artifacts | ||
|
|
||
| - name: Run RSpec | ||
| if: ${{ always() }} | ||
| run: | | ||
| docker compose exec app rspec --format progress --format html --out artifacts/rspec.html | ||
|
|
||
| - name: Run Rubocop | ||
| if: ${{ always() }} | ||
| run: | | ||
| docker compose exec app rubocop --format progress --format html --out artifacts/rubocop.html | ||
|
|
||
| - name: Copy out artifacts | ||
| if: ${{ always() }} | ||
| run: | | ||
| docker compose cp app:/opt/app/artifacts ./ | ||
| docker compose logs > artifacts/docker-compose-services.log | ||
| docker compose config > artifacts/docker-compose.merged.yml | ||
|
|
||
| - name: Upload the test report | ||
| if: ${{ always() }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: SFTP_HANDLER Build Report (${{ github.run_id }}_${{ github.run_attempt }}) | ||
| path: artifacts/* | ||
| if-no-files-found: error | ||
|
|
||
| push: | ||
| runs-on: ubuntu-24.04 | ||
| needs: | ||
| - merge | ||
| - test | ||
| env: | ||
| DOCKER_APP_IMAGE: ${{ needs.merge.outputs.build-image }} | ||
| DOCKER_APP_IMAGE_ARM64: ${{ needs.merge.outputs.build-image-arm }} | ||
| DOCKER_APP_IMAGE_X64: ${{ needs.merge.outputs.build-image-x64 }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Produce permanent image tags | ||
| id: branch-meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| tags: | | ||
| type=sha | ||
| type=ref,event=branch | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
|
||
| - name: Retag and push the image | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| $(jq -cr '.tags | map("--tag " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") $DOCKER_APP_IMAGE_ARM64 $DOCKER_APP_IMAGE_X64 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Push Release Tags | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - '**' | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| DOCKER_METADATA_SET_OUTPUT_ENV: 'true' | ||
|
|
||
| jobs: | ||
| retag: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Determine the sha-based image tag to retag | ||
| id: get-base-image | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| tags: type=sha | ||
|
|
||
| - name: Verify that the image was previously built | ||
| env: | ||
| BASE_IMAGE: ${{ steps.get-base-image.outputs.tags }} | ||
| run: | | ||
| docker manifest inspect "$BASE_IMAGE" | ||
|
|
||
| - name: Produce release tags | ||
| id: tag-meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| flavor: latest=false | ||
| tags: | | ||
| type=ref,event=tag | ||
| type=semver,pattern={{major}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=semver,pattern={{version}} | ||
|
|
||
| - name: Retag the pulled image | ||
| env: | ||
| BASE_IMAGE: ${{ steps.get-base-image.outputs.tags }} | ||
| run: | | ||
davezuckerman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| docker buildx imagetools create \ | ||
| $(jq -cr '.tags | map("--tag " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
| "$(echo "$BASE_IMAGE" | cut -f1 -d:)" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,7 @@ GEM | |
| hashdiff (>= 0.4.0, < 2.0.0) | ||
|
|
||
| PLATFORMS | ||
| aarch64-linux | ||
| x86_64-darwin-19 | ||
| x86_64-linux | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2025 The Regents of the University of California | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| services: | ||
| app: | ||
| build: !reset | ||
| image: ${DOCKER_APP_IMAGE} | ||
| environment: !override | ||
| LBNL_FILENAME: "test" | ||
| entrypoint: ["tail", "-f", "/dev/null"] | ||
| volumes: !override | ||
| - artifacts:/opt/app/artifacts | ||
|
|
||
| volumes: | ||
| artifacts: | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| LIT_GOBI_PASSWORD='password' | ||
| LIT_GOBI_USERNAME='username' | ||
| LIT_LBNL_KEY_DATA='ssh key' | ||
| LIT_LBNL_USERNAME='username' | ||
| LBNL_FILENAME='the base name for the lbnl file' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.