Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkinsfile: update to latest docker tag #558

Merged
merged 15 commits into from
Sep 29, 2018
Merged

Conversation

julianoes
Copy link
Collaborator

This includes sudo.

This is a follow up to #557.

julianoes and others added 2 commits September 24, 2018 10:52
- set timeout to 1 hour
- throw away old build logs, keep 10
- remove unnecessary pipeline agent, blocking the node
- formatting changes for readability
@lamping7 lamping7 mentioned this pull request Sep 24, 2018
@julianoes
Copy link
Collaborator Author

@dbowerman do you know why travis-ci ends up without permission:
https://travis-ci.org/Dronecode/DronecodeSDK/jobs/432376354#L575-L577

@dbowerman
Copy link
Contributor

@julianoes only that somehow $TRAVIS_BUILD_DIR at that point is not valid. ie the container mounted some dud directory.

@JonasVautherin
Copy link
Collaborator

@julianoes: About the examples, I believe that it should be possible to build them without sudo:

  1. Install the SDK locally (using INSTALL_PREFIX).
  2. Build examples with CPLUS_INCLUDE_PATH=/path/to/installed/include and LIBRARY_PATH=/path/to/installed/lib.
  3. Run the examples (possibly with LD_LIBRARY_PATH, but I'm not even sure that's necessary here).

@julianoes
Copy link
Collaborator Author

@JonasVautherin yes that would work but it means the setup is a bit different from the real use case but I guess that's ok.

@dbowerman
Copy link
Contributor

dbowerman commented Sep 26, 2018

Is the issue the 'user' option being passed to docker. ie. -u stat -c "%u:%g" $TRAVIS_BUILD_DIR ?
Inside the container the users are 'dronecode' and 'root' or more correctly 'dronecode' and 'dronecode using sudo'.

I reckon remove the -u option, which is causing the container to be run with some random user from outside the container.

@JonasVautherin JonasVautherin self-requested a review September 26, 2018 23:19
@julianoes
Copy link
Collaborator Author

I don't understand the error that now happens on Fedora:

dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: line 0: cd: build/default: Not a directory
Build dir: build/default
/bin/sh: line 0: cd: build/default: Not a directory

@julianoes
Copy link
Collaborator Author

@dbowerman the problem is that the solution with the default dronecode user only works if you're using docker as the user with ID 1000. For everything else you seem to run into troubles.

In my opinion the solution before with just root just worked even though it would sometimes require a sudo make clean to clean up.

@dbowerman
Copy link
Contributor

@julianoes Ah yes. thinking about it, that makes sense. I didn't pick that because I'm the only user (usually uid 1000) on my systems. Give me a day or so to see if theres a solution, otherwise revert I guess.

@dbowerman
Copy link
Contributor

@julianoes this article describes the exact problem and offers a solution.
https://denibertovic.com/posts/handling-permissions-with-docker-volumes/
Do you want to go down that path? or revert?

@julianoes
Copy link
Collaborator Author

@dbowerman oh yes nice, that should work.

@julianoes
Copy link
Collaborator Author

julianoes commented Sep 28, 2018

@dbowerman hm, so I tried this and got:

Starting with UID : 9001
useradd: Permission denied.
useradd: cannot lock /etc/passwd; try again later.
su: user user does not exist

Edit: nevermind, I still had the docker run -u argument left over.

@julianoes
Copy link
Collaborator Author

Note: I'm trying to come by without gosu for now, we'll see if that's good enough.

@julianoes
Copy link
Collaborator Author

Forgot to update the docker images, re-running travis.

@julianoes
Copy link
Collaborator Author

Yay, it finally passed. @JonasVautherin please review and merge, so CI is fixed.

@JonasVautherin
Copy link
Collaborator

Thanks!

@JonasVautherin JonasVautherin merged commit 3744602 into develop Sep 29, 2018
@julianoes julianoes deleted the pr-557-follow-up branch September 30, 2018 05:29
@julianoes julianoes mentioned this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants