Skip to content

Commit

Permalink
Merge pull request #228 from HumairAK/v1.1.x
Browse files Browse the repository at this point in the history
Add push artifact work around.
  • Loading branch information
HumairAK authored Jul 28, 2023
2 parents ddb30e9 + b868694 commit 1d4b8f6
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM registry.redhat.io/ubi8/go-toolset:1.18.9-8 as builder
FROM registry.access.redhat.com/ubi8/go-toolset:1.18.9-8 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
13 changes: 10 additions & 3 deletions config/internal/apiserver/artifact_script.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ data:
artifact_script: |-
#!/usr/bin/env sh
push_artifact() {
if [ -f "$2" ]; then
tar -cvzf $1.tgz $2
aws s3 --endpoint {{.ObjectStorageConnection.Endpoint}} cp $1.tgz s3://{{.ObjectStorageConnection.Bucket}}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
workspace_dir=$(echo $(context.taskRun.name) | sed -e "s/$(context.pipeline.name)-//g")
workspace_dest=/workspace/${workspace_dir}/artifacts/$(context.pipelineRun.name)/$(context.taskRun.name)
artifact_name=$(basename $2)
if [ -f "$workspace_dest/$artifact_name" ]; then
echo sending to: ${workspace_dest}/${artifact_name}
tar -cvzf $1.tgz -C ${workspace_dest} ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
elif [ -f "$2" ]; then
tar -cvzf $1.tgz -C $(dirname $2) ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
else
echo "$2 file does not exist. Skip artifact tracking for $1"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ data:
artifact_script: |-
#!/usr/bin/env sh
push_artifact() {
if [ -f "$2" ]; then
tar -cvzf $1.tgz $2
aws s3 --endpoint http://minio-testdsp0.default.svc.cluster.local:9000 cp $1.tgz s3://mlpipeline/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
workspace_dir=$(echo $(context.taskRun.name) | sed -e "s/$(context.pipeline.name)-//g")
workspace_dest=/workspace/${workspace_dir}/artifacts/$(context.pipelineRun.name)/$(context.taskRun.name)
artifact_name=$(basename $2)
if [ -f "$workspace_dest/$artifact_name" ]; then
echo sending to: ${workspace_dest}/${artifact_name}
tar -cvzf $1.tgz -C ${workspace_dest} ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
elif [ -f "$2" ]; then
tar -cvzf $1.tgz -C $(dirname $2) ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
else
echo "$2 file does not exist. Skip artifact tracking for $1"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ data:
artifact_script: |-
#!/usr/bin/env sh
push_artifact() {
if [ -f "$2" ]; then
tar -cvzf $1.tgz $2
aws s3 --endpoint http://minio-testdsp2.default.svc.cluster.local:9000 cp $1.tgz s3://mlpipeline/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
workspace_dir=$(echo $(context.taskRun.name) | sed -e "s/$(context.pipeline.name)-//g")
workspace_dest=/workspace/${workspace_dir}/artifacts/$(context.pipelineRun.name)/$(context.taskRun.name)
artifact_name=$(basename $2)
if [ -f "$workspace_dest/$artifact_name" ]; then
echo sending to: ${workspace_dest}/${artifact_name}
tar -cvzf $1.tgz -C ${workspace_dest} ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
elif [ -f "$2" ]; then
tar -cvzf $1.tgz -C $(dirname $2) ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
else
echo "$2 file does not exist. Skip artifact tracking for $1"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ data:
artifact_script: |-
#!/usr/bin/env sh
push_artifact() {
if [ -f "$2" ]; then
tar -cvzf $1.tgz $2
aws s3 --endpoint http://minio-testdsp4.default.svc.cluster.local:9000 cp $1.tgz s3://mlpipeline/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
workspace_dir=$(echo $(context.taskRun.name) | sed -e "s/$(context.pipeline.name)-//g")
workspace_dest=/workspace/${workspace_dir}/artifacts/$(context.pipelineRun.name)/$(context.taskRun.name)
artifact_name=$(basename $2)
if [ -f "$workspace_dest/$artifact_name" ]; then
echo sending to: ${workspace_dest}/${artifact_name}
tar -cvzf $1.tgz -C ${workspace_dest} ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
elif [ -f "$2" ]; then
tar -cvzf $1.tgz -C $(dirname $2) ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
else
echo "$2 file does not exist. Skip artifact tracking for $1"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ data:
artifact_script: |-
#!/usr/bin/env sh
push_artifact() {
if [ -f "$2" ]; then
tar -cvzf $1.tgz $2
aws s3 --endpoint http://minio-testdsp5.default.svc.cluster.local:9000 cp $1.tgz s3://mlpipeline/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
workspace_dir=$(echo $(context.taskRun.name) | sed -e "s/$(context.pipeline.name)-//g")
workspace_dest=/workspace/${workspace_dir}/artifacts/$(context.pipelineRun.name)/$(context.taskRun.name)
artifact_name=$(basename $2)
if [ -f "$workspace_dest/$artifact_name" ]; then
echo sending to: ${workspace_dest}/${artifact_name}
tar -cvzf $1.tgz -C ${workspace_dest} ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
elif [ -f "$2" ]; then
tar -cvzf $1.tgz -C $(dirname $2) ${artifact_name}
aws s3 --endpoint ${ARTIFACT_ENDPOINT} cp $1.tgz s3://${ARTIFACT_BUCKET}/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
else
echo "$2 file does not exist. Skip artifact tracking for $1"
fi
Expand Down

0 comments on commit 1d4b8f6

Please sign in to comment.