Skip to content

Commit

Permalink
Add CSI test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Lamparelli <[email protected]>
  • Loading branch information
lampajr committed Jun 23, 2024
1 parent 31f9287 commit ba85bd7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/csi-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test container image build and deployment
on:
pull_request:
paths-ignore:
- "LICENSE*"
- "**.gitignore"
- "**.md"
- "**.txt"
- ".github/ISSUE_TEMPLATE/**"
- ".github/dependabot.yml"
- "docs/**"
- "clients/python/docs/**"
env:
IMG_ORG: kubeflow
IMG_REPO: model-registry
PUSH_IMAGE: false
BRANCH: ${{ github.base_ref }}
jobs:
build-and-test-csi-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate tag
shell: bash
id: tags
run: |
commit_sha=${{ github.event.after }}
tag=main-${commit_sha:0:7}
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Build local model registry image
shell: bash
env:
VERSION: ${{ steps.tags.outputs.tag }}
run: ./scripts/build_deploy.sh

- name: Build local custom storage initializer
working-directory: ./csi
shell: bash
env:
IMG_VERSION: ${{ steps.tags.outputs.tag }}
# TODO: update go.mod to use local model registry library
run: make docker-build

- name: Start KinD cluster
uses: helm/[email protected]
with:
node_image: "kindest/node:v1.27.11"

- name: Install kustomize
run: ./csi/scripts/install_kustomize.sh

- name: Run tests
working-directory: ./csi
shell: bash
env:
MR_IMG: "${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}"
MR_CSI_IMG: "${{ env.IMG_ORG }}/${{ env.IMG_REPO }}-storage-initializer:${{ steps.tags.outputs.tag }}"
run: ./test/e2e_test.sh
2 changes: 1 addition & 1 deletion csi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USER root
COPY ["Makefile", "main.go", "./"]

# Copy rest of the source
COPY bin/ bin/
# COPY bin/ bin/
COPY pkg/ pkg/

# Build
Expand Down
2 changes: 1 addition & 1 deletion csi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ run: fmt vet ## Run the program
${GO} run ./main.go $(SOURCE_URI) $(DEST_PATH)

.PHONY: docker-build
docker-build: test ## Build container image.
docker-build: ## Build container image.
${DOCKER} build . -f ./Dockerfile -t ${IMG}

.PHONY: docker-push
Expand Down
6 changes: 6 additions & 0 deletions csi/scripts/install_kustomize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
curl --silent --location --remote-name "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.2.1/kustomize_v5.2.1_linux_amd64.tar.gz"
tar -xzvf kustomize_v5.2.1_linux_amd64.tar.gz
chmod a+x kustomize
sudo mv kustomize /usr/local/bin/kustomize

0 comments on commit ba85bd7

Please sign in to comment.