Skip to content

Commit 02199da

Browse files
authored
Replace gcloud genomic command with pipelines tool (#471)
gcloud alpha genomic pipelines run command may fail for gsutil copy logging step.
1 parent dfdb47a commit 02199da

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

docker/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
# To build a new docker image, run the following from the root source dir:
1616
# $ docker build . -f docker/Dockerfile -t $IMAGE_NAME
1717

18-
FROM google/cloud-sdk
18+
FROM golang:1.11
19+
20+
RUN go get -ldflags '-extldflags "-fno-PIC -static"' -buildmode pie -tags 'osusergo netgo static_build' github.com/googlegenomics/pipelines-tools/pipelines
21+
22+
FROM google/cloud-sdk:slim
23+
24+
COPY --from=0 /go/bin/pipelines /usr/bin
1925

2026
ARG commit_sha
2127
ENV COMMIT_SHA=${commit_sha}

docker/pipelines_runner.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,15 @@ function main {
7575
exit 1
7676
fi
7777

78-
operation_info=$( (`gcloud alpha genomics pipelines run \
79-
--project "${google_cloud_project}" \
80-
--logging "${temp_location}"/runner_logs_$(date +%Y%m%d_%H%M%S).log \
81-
--service-account-scopes "https://www.googleapis.com/auth/cloud-platform" \
78+
pipelines --project "${google_cloud_project}" run \
79+
--command "/opt/gcp_variant_transforms/bin/${command} --project ${google_cloud_project}" \
80+
--output "${temp_location}"/runner_logs_$(date +%Y%m%d_%H%M%S).log \
81+
--wait \
82+
--scopes "https://www.googleapis.com/auth/cloud-platform" \
8283
--zones "${zones}" \
83-
--docker-image "${vt_docker_image}" \
84-
--command-line "/opt/gcp_variant_transforms/bin/${command} --project ${google_cloud_project}"`) 2>&1)
85-
86-
operation_id="$(echo ${operation_info} | grep -o -P '(?<=operations/).*(?=])')"
87-
gcloud alpha genomics operations wait ${operation_id}
84+
--image "${vt_docker_image}" \
85+
--pvm-attempts 0 \
86+
--attempts 1
8887
}
8988

9089
main "$@"

0 commit comments

Comments
 (0)