-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c41fcd9
commit 285770b
Showing
9 changed files
with
74 additions
and
59 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,15 @@ | ||
FROM docker.io/python:3.9 | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy the script into the container | ||
COPY package_upload.sh /app/package_upload.sh | ||
|
||
# Make sure the script is executable | ||
RUN chmod +x /app/package_upload.sh | ||
|
||
# Store the files in a folder | ||
VOLUME /app/packages | ||
|
||
ENTRYPOINT ["/app/package_upload.sh"] |
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,33 +1,12 @@ | ||
#!/usr/bin/env bash | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
kfp_directory=kfp | ||
boto_directory=boto3 | ||
|
||
mkdir -p "$kfp_directory" | ||
mkdir -p "$boto_directory" | ||
|
||
# Download kfp package | ||
pip download kfp==2.7.0 -d "$kfp_directory" | ||
|
||
# Download boto3 package | ||
pip download boto3 -d "$boto_directory" | ||
|
||
|
||
# Print the pods in the namespace | ||
oc -n test-pypiserver get pods | ||
|
||
pod_name=$(oc -n test-pypiserver get pod | grep pypi | awk '{print $1}') | ||
|
||
# Copy kfp packages | ||
for kfp_entry in "$kfp_directory"/*; do | ||
echo oc -n test-pypiserver cp "$kfp_entry" $pod_name:/opt/app-root/packages | ||
oc -n test-pypiserver cp "$kfp_entry" $pod_name:/opt/app-root/packages | ||
done | ||
|
||
# Copy boto3 packages | ||
for boto_entry in "$boto_directory"/*; do | ||
echo oc -n test-pypiserver cp "$boto_entry" $pod_name:/opt/app-root/packages | ||
oc -n test-pypiserver cp "$boto_entry" $pod_name:/opt/app-root/packages | ||
# Download packages | ||
for python_version in "3.9" "3.10" "3.11" "3.12"; do | ||
for package in "kfp" "numpy"; do | ||
# If we don't set the --python it will use the one from the computer that may not be the one that the | ||
# pipeline is running | ||
pip download $package -d packages --only-binary=:none: --python $python_version | ||
done | ||
done |
18 changes: 18 additions & 0 deletions
18
.github/scripts/python_package_upload/package_upload_run.sh
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,18 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
mkdir -p /tmp/packages | ||
docker rm package_upload_run || true | ||
docker build -t package_upload . | ||
docker run --name package_upload_run -v /tmp/packages:/app/packages package_upload | ||
|
||
# Print the pods in the namespace | ||
oc -n test-pypiserver get pods | ||
|
||
pod_name=$(oc -n test-pypiserver get pod | grep pypi | awk '{print $1}') | ||
|
||
# Copy packages | ||
for entry in /tmp/packages/*; do | ||
oc -n test-pypiserver cp "$entry" $pod_name:/opt/app-root/packages | ||
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
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 |
---|---|---|
|
@@ -34,4 +34,3 @@ Dockerfile.cross | |
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
.github/scripts/python_package_upload/ |
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 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