Giter Club home page Giter Club logo

Comments (6)

NorseGaud avatar NorseGaud commented on September 1, 2024 2

For anyone interested in a solution... We installed buildkite-agent in the dockerfile and just used the --token and --agent-access-token to do start or upload commands in the various scripts. We did have to pass in the right ENVs which were available on the first docker layer:

environment:
  - "BUILDKITE_AGENT_ACCESS_TOKEN" # Needed for buildkite-agent upload
mount-buildkite-agent: false # Mounting bk-agent doesn't work, so disable it
propagate-environment: true # Need for buildkite-agent upload (JOB_ID, etc)

from docker-buildkite-plugin.

toolmantim avatar toolmantim commented on September 1, 2024

Hey @NorseGaud! Sorry for not spotting this earlier.

Does /usr/local/bin/buildkite-agent exist on the host (if you run a command with ls -lsa /usr/local/bin/buildkite-agent)? And I wonder if it's being disallowed to be bind-mounted into the container, or that's being blocked somehow?

from docker-buildkite-plugin.

NorseGaud avatar NorseGaud commented on September 1, 2024

No problem, sorry for the delay. I got pulled into an urgent issue. Here are the results without mount-buildkite-agent specified in our pipeline.yml:

ls -laht /usr/local/bin/buildkite-agent; ls -laht /usr/bin/buildkite-agent

ls: cannot access /usr/local/bin/buildkite-agent: No such file or directory
--
  | total 8.0K
  | dr-xr-xr-x 1 root root 4.0K Jul 25 17:31 ..
  | drwxr-xr-x 2 root root 4.0K Jul 24 19:50 .

Checking on the bind-mount permissions.

from docker-buildkite-plugin.

NorseGaud avatar NorseGaud commented on September 1, 2024

Ok, I just ran a test using volumes and got the following:

          volumes:
            - "/usr/local/bin/buildkite-agent"
total 8.0K
--
  | drwxr-xr-x 1 root root 4.0K Jul 25 17:38 ..
  | drwxr-xr-x 2 root root 4.0K Jul 25 17:38 .
  | total 8.0K
  | dr-xr-xr-x 1 root root 4.0K Jul 25 17:38 ..
  | drwxr-xr-x 2 root root 4.0K Jul 24 22:19 .

So even volumes is mounting an empty directory instead of the file.

from docker-buildkite-plugin.

NorseGaud avatar NorseGaud commented on September 1, 2024

Aha! On my local machine, same:

command -v buildkite-agent
/usr/local/bin/buildkite-agent

docker run -ti --rm -v $(pwd):/workdir -v /usr/local/bin/buildkite-agent eosio/producer:eosio-ubuntu-18.04-97c66ab9db7382be04dea9e9
598fd110d66432f1 bash
root@4a86d4037865:/# command -v buildkite-agent
root@4a86d4037865:/# ll /usr/local/bin/
total 56676
drwxr-xr-x 1 root root     4096 Jul 25 17:41 ./
drwxr-xr-x 1 root root     4096 Jul 25 13:23 ../
drwxr-xr-x 2 root root     4096 Jul 25 17:41 buildkite-agent/
-rwxr-xr-x 1 root root 18833304 Jul 25 13:23 cmake*
-rwxr-xr-x 1 root root 18844128 Jul 25 13:23 cpack*
-rwxr-xr-x 1 root root 20312080 Jul 25 13:23 ctest*
-rwxr-xr-x 1 root root    24720 Jul 25 13:26 mongoc-stat*

from docker-buildkite-plugin.

NorseGaud avatar NorseGaud commented on September 1, 2024

Furthermore, mounting the dir where it is doesn't work either:

docker run -ti --rm -v $(pwd):/workdir -v /usr/local/bin:/host-bin eosio/producer:eosio-ubuntu-18.04-97c66ab9db7382be04dea9e9598fd110d66432f1 bash
root@44a3b6b66446:/# ls -laht /host-bin/
total 158M
drwxr-xr-x 1 root root 4.0K Jul 25 17:43 ..
drwxr-xr-x 2 root root 2.0K Feb 13 10:29 .
-rwxr-xr-x 1 root root  27M Feb 10 04:14 containerd
-rwxr-xr-x 1 root root 4.8M Feb 10 04:14 containerd-shim
-rwxr-xr-x 1 root root  15M Feb 10 04:14 ctr
-rwxr-xr-x 1 root root  49M Feb 10 04:14 docker
-rwxr-xr-x 1 root root 747K Feb 10 04:14 docker-init
-rwxr-xr-x 1 root root 2.8M Feb 10 04:14 docker-proxy
-rwxr-xr-x 1 root root  52M Feb 10 04:14 dockerd
-rwxr-xr-x 1 root root 7.2M Feb 10 04:14 runc

If I ls -laht /usr/local/bin on the host I get a ton more stuff.

Found docker/for-win#25 which is for windows...

Update: Just realized we're doing docker inside of docker. So it doesn't exist to mount. Not a plugin issue!

from docker-buildkite-plugin.

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.