forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flytectl sandbox for ci (flyteorg#292)
* flytectl for ci Signed-off-by: Yuvraj <[email protected]>
- Loading branch information
Showing
10 changed files
with
118 additions
and
133 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
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,78 @@ | ||
name: Serialize & Release Examples | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'cookbook/docs/**' | ||
- 'cookbook/deployment/**' | ||
create: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
serialize-example: | ||
name: Serialize | ||
strategy: | ||
matrix: | ||
directory: [ "core", "integrations", "case_studies" ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
- uses: actions/cache@v1 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
path: /tmp/release-snacks-${{ matrix.directory }}/ | ||
key: release-snacks-${{ matrix.directory }}-${{ github.sha }} | ||
- name: Serialize Examples | ||
env: | ||
REGISTRY: "ghcr.io/flyteorg" | ||
run: | | ||
REGISTRY=ghcr.io/flyteorg VERSION=latest make -C cookbook/${{ matrix.directory }} serialize | ||
- name: Cache Serialized protos | ||
if: github.event_name != 'pull_request' | ||
env: | ||
REGISTRY: "ghcr.io/flyteorg" | ||
run: | | ||
mkdir -p cookbook/release-snacks /tmp/release-snacks-${{ matrix.directory }}/ | ||
make -C cookbook archive | ||
cp -r /tmp/release-snacks-${{ matrix.directory }}/* cookbook/release-snacks/ | ||
releaser: | ||
name: Release example | ||
runs-on: ubuntu-latest | ||
if: github.event_name != 'pull_request' | ||
needs: [ serialize-example ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: /tmp/release-snacks-core/ | ||
key: release-snacks-core-${{ github.sha }} | ||
- uses: actions/cache@v1 | ||
with: | ||
path: /tmp/release-snacks-case_studies/ | ||
key: release-snacks-case_studies-${{ github.sha }} | ||
- uses: actions/cache@v1 | ||
with: | ||
path: /tmp/release-snacks-integrations/ | ||
key: release-snacks-integrations-${{ github.sha }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
ref: ${{ steps.bump-version.outputs.tag }} | ||
- name: Copy artifacts | ||
run: | | ||
mkdir -p cookbook/release-snacks | ||
cp -r /tmp/release-snacks-core/* cookbook/release-snacks/ | ||
cp -r /tmp/release-snacks-case_studies/* cookbook/release-snacks/ | ||
cp -r /tmp/release-snacks-integrations/* cookbook/release-snacks/ | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} |
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 |
---|---|---|
|
@@ -21,17 +21,8 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
- run: docker pull ghcr.io/flyteorg/flyte-sandbox:dind | ||
- uses: unionai/[email protected] | ||
- name: setup sandbox | ||
run: make setup | ||
- name: wait for sandbox | ||
run: | | ||
n=0 | ||
until [ "$n" -ge 5 ]; do | ||
echo "try $n" | ||
make wait && break | ||
n=$((n+1)) | ||
sleep 1 | ||
done | ||
run: flytectl sandbox start --sourcesPath=$GITHUB_WORKSPACE | ||
- name: fast register | ||
run: REGISTRY=ghcr.io/flyteorg VERSION=latest make fast_register | ||
run: REGISTRY=ghcr.io/flyteorg VERSION=latest make fast_register |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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 | ||
|
||
set -e | ||
|
||
release_example() { | ||
for row in $(cat flyte_tests_manifest.json | jq -c '.[]'); do | ||
if [ -d "./$(echo ${row} | jq -r '.path')/_pb_output/" ]; then | ||
tar -cvzf "./release-snacks/flytesnacks-$(echo ${row} | jq -r '.name').tgz" "./$(echo ${row} | jq -r '.path')/_pb_output/" | ||
fi | ||
done | ||
} | ||
|
||
register_example() { | ||
for row in $(cat flyte_tests_manifest.json | jq -c '.[]'); do | ||
flytectl register file "./release-snacks/flytesnacks-$(echo ${row} | jq -r '.name').tgz" -p flytesnacks -d development --archive | ||
done | ||
} | ||
|
||
if [ "$1" == "RELEASE" ]; then | ||
release_example | ||
elif [ $1 == "REGISTER" ]; then | ||
register_example | ||
fi |