Skip to content

Commit

Permalink
Revert "Nvidia GPU support in the buildah-remote task"
Browse files Browse the repository at this point in the history
Added in konflux-ci#1529 due to tektoncd/pipeline#8388
as this is not yet deployed in the cluster.

This reverts commit 51cb724.
  • Loading branch information
arewm committed Nov 21, 2024
1 parent bf3a7f2 commit 0be39db
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
6 changes: 1 addition & 5 deletions task-generator/remote/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,6 @@ if ! [[ $IS_LOCALHOST ]]; then
ret += "\nbuildah push \"$IMAGE\" \"oci:konflux-final-image:$IMAGE\""
ret += "\nREMOTESSHEOF"
ret += "\nchmod +x " + script + "\n"
ret += "\nPODMAN_NVIDIA_ARGS=()"
ret += "\nif [[ \"$PLATFORM\" == \"linux-g\"* ]]; then"
ret += "\n PODMAN_NVIDIA_ARGS+=(\"--device=nvidia.com/gpu=all\" \"--security-opt=label=disable\")"
ret += "\nfi\n"

if task.Spec.StepTemplate != nil {
for _, e := range task.Spec.StepTemplate.Env {
Expand All @@ -244,7 +240,7 @@ if ! [[ $IS_LOCALHOST ]]; then
env += " -e " + e.Name + "=\"$" + e.Name + "\" \\\n"
}
podmanArgs += " -v \"$BUILD_DIR/scripts:/scripts:Z\" \\\n"
ret += "\n ssh $SSH_ARGS \"$SSH_HOST\" $PORT_FORWARD podman run " + env + "" + podmanArgs + " --user=0 \"${PODMAN_NVIDIA_ARGS[@]}\" --rm \"$BUILDER_IMAGE\" /" + containerScript + ` "$@"`
ret += "\n ssh $SSH_ARGS \"$SSH_HOST\" $PORT_FORWARD podman run " + env + "" + podmanArgs + " --user=0 --rm \"$BUILDER_IMAGE\" /" + containerScript + ` "$@"`

// Sync the contents of the workspaces back so subsequent tasks can use them
for _, workspace := range task.Spec.Workspaces {
Expand Down
7 changes: 1 addition & 6 deletions task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,6 @@ spec:
REMOTESSHEOF
chmod +x scripts/script-build.sh
PODMAN_NVIDIA_ARGS=()
if [[ "$PLATFORM" == "linux-g"* ]]; then
PODMAN_NVIDIA_ARGS+=("--device=nvidia.com/gpu=all" "--security-opt=label=disable")
fi
if ! [[ $IS_LOCALHOST ]]; then
rsync -ra scripts "$SSH_HOST:$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" $PORT_FORWARD podman run $PODMAN_PORT_FORWARD \
Expand Down Expand Up @@ -482,7 +477,7 @@ spec:
-v "$BUILD_DIR/.docker/:/root/.docker:Z" \
-v "$BUILD_DIR/results/:/tekton/results:Z" \
-v "$BUILD_DIR/scripts:/scripts:Z" \
--user=0 "${PODMAN_NVIDIA_ARGS[@]}" --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
--user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/workdir/" /var/workdir/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
Expand Down
7 changes: 1 addition & 6 deletions task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,6 @@ spec:
REMOTESSHEOF
chmod +x scripts/script-build.sh
PODMAN_NVIDIA_ARGS=()
if [[ "$PLATFORM" == "linux-g"* ]]; then
PODMAN_NVIDIA_ARGS+=("--device=nvidia.com/gpu=all" "--security-opt=label=disable")
fi
if ! [[ $IS_LOCALHOST ]]; then
rsync -ra scripts "$SSH_HOST:$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" $PORT_FORWARD podman run $PODMAN_PORT_FORWARD \
Expand Down Expand Up @@ -613,7 +608,7 @@ spec:
-v "$BUILD_DIR/.docker/:/root/.docker:Z" \
-v "$BUILD_DIR/results/:/tekton/results:Z" \
-v "$BUILD_DIR/scripts:/scripts:Z" \
--user=0 "${PODMAN_NVIDIA_ARGS[@]}" --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
--user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/workdir/" /var/workdir/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
Expand Down
7 changes: 1 addition & 6 deletions task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,6 @@ spec:
REMOTESSHEOF
chmod +x scripts/script-build.sh
PODMAN_NVIDIA_ARGS=()
if [[ "$PLATFORM" == "linux-g"* ]]; then
PODMAN_NVIDIA_ARGS+=("--device=nvidia.com/gpu=all" "--security-opt=label=disable")
fi
if ! [[ $IS_LOCALHOST ]]; then
rsync -ra scripts "$SSH_HOST:$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" $PORT_FORWARD podman run $PODMAN_PORT_FORWARD \
Expand Down Expand Up @@ -475,7 +470,7 @@ spec:
-v "$BUILD_DIR/.docker/:/root/.docker:Z" \
-v "$BUILD_DIR/results/:/tekton/results:Z" \
-v "$BUILD_DIR/scripts:/scripts:Z" \
--user=0 "${PODMAN_NVIDIA_ARGS[@]}" --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
--user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
rsync -ra "$SSH_HOST:$BUILD_DIR/workspaces/source/" "$(workspaces.source.path)/"
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
Expand Down
7 changes: 1 addition & 6 deletions task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,6 @@ spec:
REMOTESSHEOF
chmod +x scripts/script-build.sh
PODMAN_NVIDIA_ARGS=()
if [[ "$PLATFORM" == "linux-g"* ]]; then
PODMAN_NVIDIA_ARGS+=("--device=nvidia.com/gpu=all" "--security-opt=label=disable")
fi
if ! [[ $IS_LOCALHOST ]]; then
rsync -ra scripts "$SSH_HOST:$BUILD_DIR"
ssh $SSH_ARGS "$SSH_HOST" $PORT_FORWARD podman run $PODMAN_PORT_FORWARD \
Expand Down Expand Up @@ -591,7 +586,7 @@ spec:
-v "$BUILD_DIR/.docker/:/root/.docker:Z" \
-v "$BUILD_DIR/results/:/tekton/results:Z" \
-v "$BUILD_DIR/scripts:/scripts:Z" \
--user=0 "${PODMAN_NVIDIA_ARGS[@]}" --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
--user=0 --rm "$BUILDER_IMAGE" /scripts/script-build.sh "$@"
rsync -ra "$SSH_HOST:$BUILD_DIR/workspaces/source/" "$(workspaces.source.path)/"
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
Expand Down

0 comments on commit 0be39db

Please sign in to comment.