Skip to content

Commit

Permalink
Fixes after testing.
Browse files Browse the repository at this point in the history
Signed-off-by: Revital Sur <eres@il.ibm.com>
  • Loading branch information
revit13 committed Jul 2, 2024
1 parent a9d7209 commit f7de624
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 84 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/test-images.yml

This file was deleted.

209 changes: 180 additions & 29 deletions .github/workflows/test-src.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Code
name: Build, Test and (Optionally) Push images

on:
workflow_dispatch:
Expand All @@ -11,6 +11,20 @@ on:
- "dev"
- "releases/**"
jobs:
infer_version:
runs-on: ubuntu-22.04
outputs:
publish_images: ${{ steps.version.outputs.publish_images }}
steps:
- id: version
run: |
publish_images='false'
echo ${GITHUB_REPOSITORY}
if [[ ${GITHUB_REF} == refs/heads/dev && ${GITHUB_EVENT_NAME} != 'pull_request' && ${GITHUB_REPOSITORY} == 'IBM/data-prep-kit' ]] ;
then
publish_images='true'
fi
echo "publish_images=$publish_images" >> "$GITHUB_OUTPUT"
test-make:
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -51,18 +65,6 @@ jobs:
- name: Test Code Transforms
run: |
make -C transforms/code DOCKER=docker venv test-src
- name: Save images
# if: ${{ github.event_name != 'pull_request' }}
run: |
make -C transforms docker-save-image
make -C kfp/kfp_ray_components docker-save-image
- name: Upload images
# if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: images
path: artifacts/*
retention-days: 1
test-language:
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -173,36 +175,185 @@ jobs:
header_text "Running ${transforms[$index]} workflow test"
make -C ${transforms[$index]} workflow-test
header_text "Run ${transforms[$index]} completed"
test-code-images:
needs: [infer_version]
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free up space in github runner
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
df -h
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/lib/jvm /usr/local/.ghcup
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
df -h
- name: Test Code Transform Images
run: |
make -C data-processing-lib DOCKER=docker image
make -C transforms/code DOCKER=docker test-image
- name: Print space
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
df -h
docker images
- name: Save images
if: needs.infer_version.outputs.publish_images == 'true'
run: make -C transforms/code docker-save-image
- name: Upload images
if: needs.infer_version.outputs.publish_images == 'true'
uses: actions/upload-artifact@v3
with:
name: images-code
path: artifacts/*
retention-days: 1
compression-level: 0
test-language-images:
needs: [infer_version]
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free up space in github runner
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
df -h
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/lib/jvm /usr/local/.ghcup
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
df -h
- name: Test language Transform Images
run: |
make -C data-processing-lib DOCKER=docker image
make -C transforms/language DOCKER=docker test-image
- name: Print space
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: df -h
- name: Save images
if: needs.infer_version.outputs.publish_images == 'true'
run: make -C transforms/language docker-save-image
- name: Upload images
if: needs.infer_version.outputs.publish_images == 'true'
uses: actions/upload-artifact@v3
with:
name: images-language
path: artifacts/*
compression-level: 0
test-universal-images:
needs: [infer_version]
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free up space in github runner
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
df -h
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/lib/jvm /usr/local/.ghcup
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
df -h
- name: Test Universal Transform Images
run: |
make -C data-processing-lib DOCKER=docker image
make -C transforms/universal DOCKER=docker test-image
- name: Print space
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
df -h
docker images
- name: Save images
if: ${{ needs.infer_version.outputs.publish_images == 'true' }}
run: make -C transforms/universal docker-save-image
- name: Upload images
if: ${{ needs.infer_version.outputs.publish_images == 'true' }}
uses: actions/upload-artifact@v3
with:
name: images-universal
path: artifacts/*
compression-level: 0
build-kfp-components:
needs: [infer_version]
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free up space in github runner
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
df -h
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/lib/jvm /usr/local/.ghcup
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
df -h
- name: Build
run: |
make -C kfp/kfp_ray_components DOCKER=docker image
- name: Print space
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: df -h
- name: Save images
if: ${{ needs.infer_version.outputs.publish_images == 'true' }}
run: make -C kfp/kfp_ray_components docker-save-image
- name: Upload images
if: ${{ needs.infer_version.outputs.publish_images == 'true' }}
uses: actions/upload-artifact@v3
with:
name: images-kfp
path: artifacts/*
compression-level: 0
test-tool-images:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test Tool images
run: |
make -C tools/ingest2parquet DOCKER=docker test-image
push-images:
name: Push images with latest tag
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: needs.infer_version.outputs.publish_images == 'true'
env:
DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }}
DOCKER_REGISTRY_KEY: ${{ secrets.DOCKER_REGISTRY_KEY }}
needs: [test-make, test-python-lib, test-ray-lib, test-kfp-v1]
# if: ${{ github.event_name != 'pull_request' && github.repository == 'IBM/data-prep-kit' }}
needs: [infer_version, test-ray-lib, test-spark-lib, test-code, test-language, test-universal, test-tools, test-kfp-v1, test-kfp-v2, test-code-images, test-language-images, test-universal-images, build-kfp-components]
steps:
- uses: actions/checkout@v3
- name: Free up space in github runner
# Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
run: |
df -h
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/lib/jvm /usr/local/.ghcup
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
df -h
- name: Download artifact
uses: actions/download-artifact@v3
with:
path: artifacts/*
name: images
- name: Load images
path: artifacts/
pattern: images-*
- name: Print artifacts dir
run: ls -ltr artifacts/
- name: Load code images
run: |
make -C transforms docker-load-image
make -C kfp-kfp_ray_componenets docker-load-image
- id: version
name: Infer version
run: |
publish_images='false'
if [[ ${GITHUB_REF} == refs/heads/dev ]] ;
then
publish_images='true'
fi
echo ::set-output name=publish_images::$publish_images
- name: Publish images
if: ${{ steps.version.outputs.publish_images == 'true' }}
if: needs.infer_version.outputs.publish_images == 'true'
# run: make -C transforms -C kfp-kfp_ray_componenets publish
run: echo "make -C transforms -C kfp-kfp_ray_componenets publish"


3 changes: 2 additions & 1 deletion .make.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DOCKER_REGISTRY_ENDPOINT?=$(DOCKER_HOSTNAME)/$(DOCKER_NAMESPACE)
DOCKER_LOCAL_IMAGE=$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION)
DOCKER_REMOTE_IMAGE=$(DOCKER_REGISTRY_ENDPOINT)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION)
DOCKER_SPARK_BASE_IMAGE_NAME=data-prep-kit-spark-3.5.1
DOCKER_SPARK_BASE_IMAGE=$(DOCKER_SPARK_BASE_IMAGE_NAME):$(DPK_LIB_VERSION)
DOCKER_SPARK_BASE_IMAGE=$(DOCKER_SPARK_BASE_IMAGE_NAME):$(DOCKER_IMAGE_VERSION)
# Deprecated in favor of DOCKER_REMOTE_IMAGE
DOCKER_IMAGE?=$(DOCKER_REMOTE_IMAGE)
KIND_CLUSTER_NAME=dataprep
Expand Down Expand Up @@ -184,6 +184,7 @@ __check_defined = \

.PHONY: .defaults.docker-save-image
.defaults.docker-save-image:
mkdir -p ${ARTIFACTS_DIR}/
docker save -o ${ARTIFACTS_DIR}/${DOCKER_IMAGE_NAME}.tar $(DOCKER_REMOTE_IMAGE)

.PHONY: .defaults.docker-load-image
Expand Down
1 change: 0 additions & 1 deletion data-processing-lib/spark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
REPOROOT=../..
include $(REPOROOT)/.make.defaults
SPARK_VERSION=3.5.1
DOCKER_IMAGE_NAME=data-prep-kit-spark-$(SPARK_VERSION)
DOCKER_IMAGE_VERSION=$(DPK_LIB_VERSION)
DOCKER_IMAGE_LIB_NAME=data-prep-kit-spark
TAG := "v${DPK_LIB_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion kfp/kfp_ray_components/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ docker-load-image:

.PHONY: docker-save-image
docker-save-image:
@$(MAKE) .defaults.docker-load-image
@$(MAKE) .defaults.docker-save-image

.PHONY: publish
publish:
Expand Down

0 comments on commit f7de624

Please sign in to comment.