Git Product home page Git Product logo

Comments (13)

mattmoor avatar mattmoor commented on July 28, 2024

@damienmg

from cloud-builders.

imjasonh avatar imjasonh commented on July 28, 2024

I tried to run the bazel builder to determine what version of Bazel it has installed, and got this error:

$ docker pull gcr.io/cloud-builders/bazel
...
Digest: sha256:f6cf5b28d6a1c8dd3f06594f48b6d43622fa27e8e56bbc12b875e4003f3d012c
Status: Downloaded newer image for gcr.io/cloud-builders/bazel:latest
$ docker run gcr.io/cloud-builders/bazel version
INFO: Reading 'startup' options from /root/.bazelrc: --output_base=/workspace/.bazel
Error: Output base directory '/workspace/.bazel' could not be created: (error: 13): Permission denied

from cloud-builders.

mattmoor avatar mattmoor commented on July 28, 2024

@bendory So this is with Bazel 0.4.5, not a 0.5 RC? I'm wondering what might have changed, don't you guys use commit sha's for your WORKSPACE references (e.g. for rules_go)?

from cloud-builders.

mattmoor avatar mattmoor commented on July 28, 2024

@imjasonh Maybe that's because you don't have a /workspace volume mounted? I'll try to repro it myself now.

from cloud-builders.

mattmoor avatar mattmoor commented on July 28, 2024
$ docker run -v /tmp/workspace/:/workspace gcr.io/cloud-builders/bazel version
INFO: Reading 'startup' options from /root/.bazelrc: --output_base=/workspace/.bazel
Build label: 0.4.5
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Mar 16 12:19:38 2017 (1489666778)
Build timestamp: 1489666778
Build timestamp as int: 1489666778

from cloud-builders.

mattmoor avatar mattmoor commented on July 28, 2024

@bendory Can you share the Docker invocation so that I might reproduce it locally with the correct working dir etc.

from cloud-builders.

imjasonh avatar imjasonh commented on July 28, 2024

@mattmoor You're totally right, I wasn't mounting in a /workspace, that was my problem. Sorry for the noise.

from cloud-builders.

mattmoor avatar mattmoor commented on July 28, 2024

This just ran successfully for me on a fresh clone, so maybe it was a fluke?

from cloud-builders.

mattmoor avatar mattmoor commented on July 28, 2024

Abbreviated log:

<SNIPPED>
Finished Step #0
Step #1: Already have image: gcr.io/convoy-adapter/bazel
Starting Step #1
Step #1: INFO: Reading 'startup' options from /root/.bazelrc: --output_base=/workspace/.bazel
Step #1: Build label: 0.4.5
Step #1: Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Step #1: Build time: Thu Mar 16 12:19:38 2017 (1489666778)
Step #1: Build timestamp: 1489666778
Step #1: Build timestamp as int: 1489666778
Finished Step #1
Step #2: Already have image: gcr.io/convoy-adapter/bazel
Starting Step #2
Step #2: INFO: Reading 'startup' options from /root/.bazelrc: --output_base=/workspace/.bazel
Step #2: ................
<SNIPPED>
Step #2: ____Building...
Step #2: ____[0 / 2] BazelWorkspaceStatusAction stable-status.txt
Step #2: ____[1 / 13] Expanding template external/bazel_tools/tools/build_defs/docker/create_image [for host]
Step #2: ____[1 / 22] Expanding template external/bazel_tools/tools/build_defs/pkg/build_tar [for host]
Step #2: ____[1 / 25] Expanding template external/bazel_tools/tools/build_defs/docker/create_image_config [for host]
Step #2: ____[1 / 26] Writing script subdir/bazel-out/local-fastbuild/bin/subdir/hello.a.GoLinkFile.params
Step #2: ____[6 / 28] Creating source manifest for @bazel_tools//tools/build_defs/pkg:build_tar [for host]
Step #2: ____[7 / 28] Creating source manifest for @bazel_tools//tools/build_defs/docker:sha256 [for host]
Step #2: ____[22 / 32] GoCompile subdir/hello.a
Step #2: Target //subdir:target up-to-date:
Step #2:   bazel-bin/subdir/target-layer.tar
Step #2: ____Elapsed time: 29.057s, Critical Path: 2.00s
Step #2: 
Step #2: ____Running command line: bazel-bin/subdir/target
Step #2: Loading b2cc9909875fc9447a2f1a433144a7dfe55225f5adf59942657afada5a250a87...
Step #2: Loaded image ID: sha256:b2cc9909875fc9447a2f1a433144a7dfe55225f5adf59942657afada5a250a87
Step #2: Tagging b2cc9909875fc9447a2f1a433144a7dfe55225f5adf59942657afada5a250a87 as bazel/subdir:target
Finished Step #2
Step #3: Already have image (with digest): gcr.io/cloud-builders/docker
Starting Step #3
Step #3: Hello world
Finished Step #3
Step #4: Already have image: gcr.io/convoy-adapter/bazel
Starting Step #4
Step #4: INFO: Reading 'startup' options from /root/.bazelrc: --output_base=/workspace/.bazel
<SNIPPED>
Step #4: ____Building...
Step #4: ____[0 / 3] BazelWorkspaceStatusAction stable-status.txt
Step #4: ____[1 / 6] Creating source manifest for //subdir:hello
Step #4: ____Building complete.
Step #4: Target //subdir:hello up-to-date:
Step #4:   bazel-bin/subdir/hello.a
Step #4:   bazel-bin/subdir/hello
Step #4: ____Elapsed time: 9.493s, Critical Path: 0.40s
Finished Step #4
Step #5: Pulling image: ubuntu
Step #5: Using default tag: latest
Step #5: latest: Pulling from library/ubuntu
Step #5: Digest: sha256:382452f82a8bbd34443b2c727650af46aced0f94a44463c62a9848133ecb1aa8
Step #5: Status: Downloaded newer image for ubuntu:latest
Starting Step #5
Step #5: Hello world
Finished Step #5
PUSH
Pushing gcr.io/convoy-adapter/bazel
The push refers to a repository [gcr.io/convoy-adapter/bazel]
<SNIPPED>
latest: digest: sha256:54677e2f84c66ef1d21a917ca2c47d5b83d19a83d6b40190a2e2661105e2472a size: 1779
DONE

from cloud-builders.

imjasonh avatar imjasonh commented on July 28, 2024

I'm also unable to reproduce on a fresh clone, on the Docker-17.05 branch. 🤷‍♂️

from cloud-builders.

bendory avatar bendory commented on July 28, 2024

This is reproducible for me in a clean directory as follows:

$ git clone [email protected]:GoogleCloudPlatform/cloud-builders.git
<SNIP>
$ cd cloud-builders/bazel/
$ git checkout Docker-17.05
Branch Docker-17.05 set up to track remote branch Docker-17.05 from origin.
Switched to a new branch 'Docker-17.05'
$ gcloud container builds submit --config=cloudbuild.yaml .
<SNIP>
Step #2: ____[22 / 32] GoCompile subdir/hello.a
Step #2: ERROR: /workspace/examples/subdir/BUILD:8:1: null failed: hello.a.GoCompileFile.params failed: error executing command 
Step #2:   (exec env - \
Step #2:     GOARCH=amd64 \
Step #2:     GOOS=linux \
Step #2:   bazel-out/local-fastbuild/bin/subdir/bazel-out/local-fastbuild/bin/subdir/hello.a.GoCompileFile.params)
Step #2: 
Step #2: Use --sandbox_debug to see verbose messages from the sandbox.
Step #2: open github.com/GoogleCloudPlatform/cloud-builders/bazel/examples/subdir/main.go: open github.com/GoogleCloudPlatform/cloud-builders/bazel/examples/subdir/main.go: permission denied
Step #2: Use --strategy=GoCompile=standalone to disable sandboxing for the failing actions.
Step #2: ____Building complete.
Step #2: Target //subdir:target failed to build
Step #2: ____Elapsed time: 27.214s, Critical Path: 0.21s
Step #2: ERROR: Build failed. Not running target.
Finished Step #2
ERROR
ERROR: build step "gcr.io/<SNIP>/bazel" failed: exit status 1

from cloud-builders.

mattmoor avatar mattmoor commented on July 28, 2024

I just ran this successfully... :-/

Step #2: ____Running command line: bazel-bin/subdir/target
Step #2: Loading 8be8b1335f0bf1885876b8e2d4f76be6598fda0fcba5e955add752350493baae...
Step #2: Loaded image ID: sha256:8be8b1335f0bf1885876b8e2d4f76be6598fda0fcba5e955add752350493baae
Step #2: Tagging 8be8b1335f0bf1885876b8e2d4f76be6598fda0fcba5e955add752350493baae as bazel/subdir:target
Finished Step #2
Step #3: Already have image (with digest): gcr.io/cloud-builders/docker
Starting Step #3
Step #3: Hello world
Finished Step #3
Step #4: Already have image: gcr.io/convoy-adapter/bazel
Starting Step #4
Step #4: INFO: Reading 'startup' options from /root/.bazelrc: --output_base=/workspace/.bazel
<SNIP>
Finished Step #4
Step #5: Pulling image: ubuntu
Step #5: Using default tag: latest
Step #5: latest: Pulling from library/ubuntu
Step #5: Digest: sha256:382452f82a8bbd34443b2c727650af46aced0f94a44463c62a9848133ecb1aa8
Step #5: Status: Downloaded newer image for ubuntu:latest
Starting Step #5
Step #5: Hello world
Finished Step #5
PUSH
Pushing gcr.io/convoy-adapter/bazel
The push refers to a repository [gcr.io/convoy-adapter/bazel]
4af3f8fe377a: Preparing
74de8154cf83: Preparing
776d5289b76e: Preparing
0fb55a72eab2: Preparing
a30ab2bcda94: Preparing
99840408c5ea: Preparing
a8e78858b03b: Preparing
99840408c5ea: Waiting
a8e78858b03b: Waiting
776d5289b76e: Layer already exists
a30ab2bcda94: Layer already exists
0fb55a72eab2: Layer already exists
a8e78858b03b: Layer already exists
99840408c5ea: Layer already exists
4af3f8fe377a: Pushed
274de8154cf83: Pushed
latest: digest: sha256:21ed6be1c10e09af009d041504ab6caec6ee7b6be0136b1e1093be4eee42cecc size: 1779
DONE
---------------------------------------------------------------------------------------------------------------------------------------------------

ID                                    CREATE_TIME                DURATION  SOURCE                                                   IMAGES                       STATUS
c5f07e93-9e2f-4e62-9969-ebb85ea6e723  2017-05-19T00:23:05+00:00  4M59S     gs://convoy-adapter_cloudbuild/source/1495153384.16.tgz  gcr.io/convoy-adapter/bazel  SUCCESS

mattmoor@bazel:~/cloud-builders/bazel$ git status
On branch Docker-17.05
Your branch is up-to-date with 'origin/Docker-17.05'.

nothing to commit, working directory clean

from cloud-builders.

imjasonh avatar imjasonh commented on July 28, 2024

Now also seeing this error when I actually build using the Bazel builder which has Docker 17.05 installed (I may have been erroneously using 1.12.6 when I got it to pass before?)

$ git clone [email protected]:GoogleCloudPlatform/cloud-builders.git fresh
$ cd fresh/bazel
$ git checkout Docker-17.05 
Switched to branch 'Docker-17.05'
Your branch is up-to-date with 'origin/Docker-17.05'.
$ grep 17.05 Dockerfile 
    apt-get -y install docker-engine=17.05.0~ce-0~ubuntu-trusty && \
$ gcloud container builds submit . --config=cloudbuild.yaml
<SNIP>
Step #2: ____[13 / 32] Creating source manifest for @bazel_tools//tools/build_defs/docker:sha256 [for host]
Step #2: ____[22 / 32] GoCompile subdir/hello.a
Step #2: ERROR: /workspace/examples/subdir/BUILD:8:1: null failed: hello.a.GoCompileFile.params failed: error executing command 
Step #2:   (exec env - \
Step #2:     GOARCH=amd64 \
Step #2:     GOOS=linux \
Step #2:   bazel-out/local-fastbuild/bin/subdir/bazel-out/local-fastbuild/bin/subdir/hello.a.GoCompileFile.params)
Step #2: 
Step #2: Use --sandbox_debug to see verbose messages from the sandbox.
Step #2: open github.com/GoogleCloudPlatform/cloud-builders/bazel/examples/subdir/main.go: open github.com/GoogleCloudPlatform/cloud-builders/bazel/examples/subdir/main.go: permission denied
Step #2: Use --strategy=GoCompile=standalone to disable sandboxing for the failing actions.
Step #2: ____Building complete.
Step #2: Target //subdir:target failed to build
Step #2: ____Elapsed time: 28.172s, Critical Path: 2.51s
Step #2: ERROR: Build failed. Not running target.
Finished Step #2
ERROR
ERROR: build step "gcr.io/test-argo/bazel" failed: exit status 1

The same build also fails for me now when the Docker version is 1.12.6, as on the master branch:

$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
$ grep 1.12.6 Dockerfile 
    # Install Docker 1.12.6 (https://docs.docker.com/engine/installation/linux/ubuntu/)
    apt-get -y install docker-engine=1.12.6-0~ubuntu-trusty && \
$ gcloud container builds submit . --config=cloudbuild.yaml
<SNIP>
Step #2: ____[22 / 32] GoCompile subdir/hello.a
Step #2: ERROR: /workspace/examples/subdir/BUILD:8:1: null failed: hello.a.GoCompileFile.params failed: error executing command 
Step #2:   (exec env - \
Step #2:     GOARCH=amd64 \
Step #2:     GOOS=linux \
Step #2:   bazel-out/local-fastbuild/bin/subdir/bazel-out/local-fastbuild/bin/subdir/hello.a.GoCompileFile.params)
Step #2: 
Step #2: Use --sandbox_debug to see verbose messages from the sandbox.
Step #2: open github.com/GoogleCloudPlatform/cloud-builders/bazel/examples/subdir/main.go: open github.com/GoogleCloudPlatform/cloud-builders/bazel/examples/subdir/main.go: permission denied
Step #2: Use --strategy=GoCompile=standalone to disable sandboxing for the failing actions.
Step #2: ____Building complete.
Step #2: Target //subdir:target failed to build
Step #2: ____Elapsed time: 28.579s, Critical Path: 1.71s
Step #2: ERROR: Build failed. Not running target.
Finished Step #2
ERROR
ERROR: build step "gcr.io/test-argo/bazel" failed: exit status 1

from cloud-builders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.