Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

[JENKINS-53304] Mount volume on the whole /evergreen #207

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ restarted if necessary.
.Starting Jenkins Evergreen
[source,bash]
----
mkdir $PWD/jenkins-home && \
docker volume create jenkins-evergreen-data && \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to using a volume as generally recommended to avoid all sorts of permission issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Is there a simple way to move a jenkins-home predating this?

Copy link
Collaborator Author

@batmat batmat Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on your definition of simple. Yes, there would be a way, though not sure we're at a stage where we should spend time of this.

I would probably basically run an evergreen container with bash (to get the right perms), just to move data around.
Something like, untested:

docker volume create jenkins-evergreen-data
docker run -v jenkins-evergreen-data:/evergreen -v $PWD/jenkins-home:/jenkins-home:ro  -ti jenkins/evergreen:docker-cloud bash

Then, initiate a copy from inside the container from /jenkin-home to /evergreen/jenkins/home. But again, not worth it's worth the hassle at this stage. I can help more if you're still willing to do it.

And for the /evergreen/jenkins/var part, you could probably docker cp the content...

docker run --name evergreen \
--restart=always \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have so that Evergreen restarts with the host if restarted. A bit easier for our users, which I guess is the goal :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about --rm for people playing with Evergreen but who do not necessarily want it running constantly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I think using --rm would be a good practice for Docker usage in general, but unsure we should do it here. Users that are not Docker experts might be surprised to see their container go away when they shut it down. But well, we have the volume, so...

-ti \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice to allow 'ctrl-C' ing the docker run. (Though I think we'll want a -d after the alpha/beta testing phase).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it --tty or --interactive which handles SIGINT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, -t should be enough, but if you read moby/moby#2838 you'll see there're many possible combinations and the only way to have it (almost? :)) always working is using both.

Basically, if you just run, then ctrl-c, -t is enough. If you like it to work also when using docker attach, it wouldn't... 🤷‍♂️

-p 8080:8080 \
-u 0 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $PWD/jenkins-home:/evergreen/jenkins/home \
-v jenkins-evergreen-data:/evergreen/ \
-e LOG_LEVEL=debug \
jenkins/evergreen:docker-cloud
----
Expand All @@ -62,7 +63,7 @@ docker exec evergreen cat /evergreen/jenkins/home/secrets/initialAdminPassword
----


=== Getting started with an AWS-baesd installation
=== Getting started with an AWS-based installation

[NOTE]
====
Expand Down Expand Up @@ -155,7 +156,7 @@ documents:
| link:https://github.com/jenkinsci/jep/blob/master/jep/309[Bill of Materials]

| JEP-310
| link:https://github.com/jenkinsci/jep/blob/master/jep/310 [Evergreen AWS auto-configuration]
| link:https://github.com/jenkinsci/jep/blob/master/jep/310[Evergreen AWS auto-configuration]

|===

Expand Down