-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gang-min-cardinality
- Loading branch information
Showing
7 changed files
with
188 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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,56 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-22.04 | ||
if: github.repository_owner == 'armadaproject' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go with Cache | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Cache GOBIN | ||
uses: actions/cache@v3 | ||
with: | ||
path: /home/runner/go/bin | ||
key: ${{ runner.os }}-gobin-${{ hashFiles('**/tools.yaml') }} | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: goreleaser/goreleaser-action@v3 | ||
with: | ||
distribution: goreleaser | ||
version: v1.20.0 | ||
args: release --snapshot --skip-sbom --skip-sign --clean | ||
env: | ||
DOCKER_REPO: "gresearch" | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" | ||
DOCKER_BUILDX_CACHE_FROM: "type=gha" | ||
DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" | ||
|
||
- name: Output full commit sha | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
run: echo "sha_full=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Save Docker image tarballs | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
run: | | ||
scripts/docker-save.sh -t ${{ env.sha_full }} -o /tmp/imgs | ||
- name: Save Docker image tarballs as artifacts | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: armada-image-tarballs | ||
path: /tmp/imgs |
This file contains 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 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Code Build and Tests | ||
name: Tests | ||
|
||
on: | ||
workflow_call: | ||
|
This file contains 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,23 @@ | ||
#!/bin/bash | ||
|
||
# This script defines common variables and functions for the other scripts. | ||
|
||
export docker_registry="gresearch" | ||
export image_names=( | ||
"armada-bundle" | ||
"armada-lookout-bundle" | ||
"armada-full-bundle" | ||
"armada-server" | ||
"armada-executor" | ||
"armada-fakeexecutor" | ||
"armada-lookout-ingester" | ||
"armada-lookout-ingester-v2" | ||
"armada-lookout" | ||
"armada-lookout-v2" | ||
"armada-event-ingester" | ||
"armada-scheduler" | ||
"armada-scheduler-ingester" | ||
"armada-binoculars" | ||
"armada-jobservice" | ||
"armadactl" | ||
) |
This file contains 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 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,45 @@ | ||
#!/bin/bash | ||
|
||
if ! source "$(dirname "$0")/common.sh"; then | ||
echo "::error ::failed to source common.sh" | ||
exit 1 | ||
fi | ||
|
||
docker_tag="" | ||
output_dir="." | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
-t|--tag) | ||
docker_tag=$2 | ||
shift | ||
shift | ||
;; | ||
-o|--output) | ||
output_dir=$2 | ||
shift | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
# validate that docker_tag is provided | ||
if [ -z "$docker_tag" ]; then | ||
echo "::error ::docker tag is must be provided with -t|--tag option" | ||
exit 1 | ||
fi | ||
|
||
# Check if output directory exists, if not create it | ||
if [[ ! -d $output_dir ]]; then | ||
if ! mkdir -p "$output_dir"; then | ||
echo "::error ::failed to create output directory $output_dir" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
for image_name in "${image_names[@]}"; do | ||
output_tarball="$output_dir/$image_name.tar" | ||
echo "::group::saving $docker_registry/$image_name:$docker_tag to $output_tarball" | ||
docker save -o "$output_tarball" "$docker_registry/$image_name:$docker_tag" | ||
echo "::endgroup::" | ||
done |