-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Devtools] Add CI For Verifying/Building/Pushing Images (#15)
* add validation ci Signed-off-by: Jordan Dubrick <[email protected]> * temp add branch name Signed-off-by: Jordan Dubrick <[email protected]> * add logic for building images Signed-off-by: Jordan Dubrick <[email protected]> * add explicit find for docker vs containerfile Signed-off-by: Jordan Dubrick <[email protected]> * change base dir to pwd Signed-off-by: Jordan Dubrick <[email protected]> * add push workflow Signed-off-by: Jordan Dubrick <[email protected]> * source env file Signed-off-by: Jordan Dubrick <[email protected]> * trigger on push event Signed-off-by: Jordan Dubrick <[email protected]> * fetch image hash Signed-off-by: Jordan Dubrick <[email protected]> * add github sha Signed-off-by: Jordan Dubrick <[email protected]> * test remove this commit Signed-off-by: Jordan Dubrick <[email protected]> * only reference changed directories instead of files Signed-off-by: Jordan Dubrick <[email protected]> * add dockerignores and env files Signed-off-by: Jordan Dubrick <[email protected]> * prefix image names with quay org Signed-off-by: Jordan Dubrick <[email protected]> * pin new action Signed-off-by: Jordan Dubrick <[email protected]> --------- Signed-off-by: Jordan Dubrick <[email protected]>
- Loading branch information
Showing
19 changed files
with
127 additions
and
0 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: Push Images | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
build: | ||
name: Push Updated Images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Login to Quay.io | ||
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf #v45.0.4 | ||
with: | ||
dir_names: 'true' | ||
|
||
- name: Push Changed Images | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
BASE_DIR=$(pwd) | ||
for dir in ${ALL_CHANGED_FILES}; do | ||
echo "Change detected in $dir ..." | ||
cd $dir | ||
if [ ! -f config.env ]; then | ||
echo "No config.env file present in changed directory, skipping ..." | ||
continue | ||
fi | ||
source config.env | ||
echo "Running 'docker build' in $dir ..." | ||
if [ -f "Containerfile" ]; then | ||
docker build -t "${IMAGE_NAME}":temp -f Containerfile . | ||
else | ||
docker build -t "${IMAGE_NAME}":temp -f Dockerfile . | ||
fi | ||
docker tag "${IMAGE_NAME}":temp "${IMAGE_NAME}":"${IMAGE_TAG}" && docker push "${IMAGE_NAME}":"${IMAGE_TAG}" | ||
docker tag "${IMAGE_NAME}":temp "${IMAGE_NAME}":"${GITHUB_SHA}" && docker push "${IMAGE_NAME}":"${GITHUB_SHA}" | ||
cd $BASE_DIR | ||
done | ||
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 @@ | ||
name: Validate Images | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
build: | ||
name: Validate Updated Images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf #v45.0.4 | ||
with: | ||
dir_names: 'true' | ||
|
||
- name: Build Changed Images | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
BASE_DIR=$(pwd) | ||
for dir in ${ALL_CHANGED_FILES}; do | ||
echo "Change detected in $dir ..." | ||
cd $dir | ||
if [ ! -f config.env ]; then | ||
echo "No config.env file present in changed directory, skipping ..." | ||
continue | ||
fi | ||
echo "Running 'docker build' in $dir ..." | ||
if [ -f "Containerfile" ]; then | ||
docker build -f Containerfile . | ||
else | ||
docker build -f Dockerfile . | ||
fi | ||
cd $BASE_DIR | ||
done | ||
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,2 +1,4 @@ | ||
# developer-images | ||
Repository catalog of the Containerfiles/Dockerfiles for the developer images | ||
|
||
When onboarding new Container/Dockerfiles please ensure a `config.env` file is present in the directory with `IMAGE_NAME` and `IMAGE_TAG` variables. |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/chroma | ||
IMAGE_TAG=latest |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/helm-chart-application-gitops | ||
IMAGE_TAG=latest |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/odh-minimal-notebook-container | ||
IMAGE_TAG=latest |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/detr-resnet-101 | ||
IMAGE_TAG=latest |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/granite-7b-lab | ||
IMAGE_TAG=latest |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/mistral-7b-code-16k-qlora | ||
IMAGE_TAG=latest |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/whisper-small | ||
IMAGE_TAG=latest |
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 @@ | ||
config.env |
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,2 @@ | ||
IMAGE_NAME=quay.io/redhat-ai-dev/utils | ||
IMAGE_TAG=latest |