From 8ed71d4682940242d697b5cee6a1bdb8a3584701 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Mon, 4 Jun 2018 12:07:42 +0200 Subject: [PATCH 1/5] docker: move legacy artifacts --- scripts/docker/{ => legacy}/Dockerfile | 0 scripts/docker/{ => legacy}/README.md | 0 scripts/docker/{ => legacy}/buildelektra.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename scripts/docker/{ => legacy}/Dockerfile (100%) rename scripts/docker/{ => legacy}/README.md (100%) rename scripts/docker/{ => legacy}/buildelektra.sh (100%) diff --git a/scripts/docker/Dockerfile b/scripts/docker/legacy/Dockerfile similarity index 100% rename from scripts/docker/Dockerfile rename to scripts/docker/legacy/Dockerfile diff --git a/scripts/docker/README.md b/scripts/docker/legacy/README.md similarity index 100% rename from scripts/docker/README.md rename to scripts/docker/legacy/README.md diff --git a/scripts/docker/buildelektra.sh b/scripts/docker/legacy/buildelektra.sh similarity index 100% rename from scripts/docker/buildelektra.sh rename to scripts/docker/legacy/buildelektra.sh From a0ebc8909b2b6fbd112765374386df17090c28a7 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Mon, 4 Jun 2018 14:19:13 +0200 Subject: [PATCH 2/5] docker: Add new README.md --- scripts/docker/README.md | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 scripts/docker/README.md diff --git a/scripts/docker/README.md b/scripts/docker/README.md new file mode 100644 index 00000000000..e719f1992ba --- /dev/null +++ b/scripts/docker/README.md @@ -0,0 +1,56 @@ +# Elektra Docker Artifacts +This folder contains all Docker related Artifacts. + +**Note:** +Any commands in this file are expected to be run from the root +of the repository. + +## Building Images locally +If you want to run or test Elektra via our Docker images you currently have +to build them yourself. +You can do so by running the following command: + +```sh +docker build -t buildelektra-stretch-full \ + --build-arg JENKINS_USERID=`id -u` \ + --build-arg JENKINS_GROUPID=`id -g` \ + -f scripts/docker/debian/stretch/Dockerfile \ + scripts/docker/debian/stretch/ +``` + +You can adapt the targetted Dockerfile via `-f`. +You should also adjust the tag used via `-t` if you are building a different +image. + +Please note that the complete images used to test Elektra are quite big +(~3.7GB) and take a some time (10min+) to build. + +## Testing Elektra via Docker images +To replicate errors on the test server you can build the image that ran the +test as shown above. + +Afterwards you can start the container via the following command: + +```sh +docker run -it --rm \ + -v `pwd`:/home/jenkins/workspace \ + -w /home/jenkins/workspace \ + buildelektra-stretch-full +``` + +Note since we used matching userid + groupid to your current user the container +will write to your mounted directory with the correct permissions. + +Once you are running inside the container you can use the same commands as you +would use normally to configure, compile and test Elektra. + +## Differences to the build server +The build server does not create a bash shell inside the containers. +Instead it runs a nonterminating command (usually `cat`) to keep the container +open. + +Afterwards it executes each step via `docker exec`. + +There might be some more differences that might influence test outcomes. +One such documented case is #2008 and #1973 where errors on the test +server could not be replicated when running identical commands locally. From 33afa56972d1389e0a11e23de2d8e832d714c0bd Mon Sep 17 00:00:00 2001 From: derwinlu Date: Mon, 4 Jun 2018 14:22:37 +0200 Subject: [PATCH 3/5] docker: Add release note --- doc/news/_preparation_next_release.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index c0becc40ab1..42e245418dc 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -177,6 +177,7 @@ These notes are of interest for people developing Elektra: - Several improvments to the build system have been implemented *(Lukas Winkler)*: - Better Docker image handling - abort of previously queued but unfinished runs on new commits + - Document how to locally replicate the Docker environment used for tests. - <> - <> - Ported GCC ASAN build job to new build system *(René Schwaiger + Lukas Winkler)* From 861c1beaa325edf8329699eb09d7d6e14c34766c Mon Sep 17 00:00:00 2001 From: derwinlu Date: Mon, 4 Jun 2018 14:23:09 +0200 Subject: [PATCH 4/5] docker: fixup spelling in release notes --- doc/news/_preparation_next_release.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index 42e245418dc..7aa3ced0aa5 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -175,8 +175,8 @@ These notes are of interest for people developing Elektra: - `clang-5.0` is now used for clang tests by the build system *(Lukas Winkler)* - An additional build job on Ubuntu:xenial has been added *(Lukas Winkler)* - Several improvments to the build system have been implemented *(Lukas Winkler)*: - - Better Docker image handling - - abort of previously queued but unfinished runs on new commits + - Better Docker image handling. + - Abort of previously queued but unfinished runs on new commits. - Document how to locally replicate the Docker environment used for tests. - <> - <> From 0a2edcd7663706d3f7c0c56dba16bb06b0baf5e5 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Mon, 4 Jun 2018 22:07:10 +0200 Subject: [PATCH 5/5] docker: implement feedback --- scripts/docker/README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/docker/README.md b/scripts/docker/README.md index e719f1992ba..1d9b68c093e 100644 --- a/scripts/docker/README.md +++ b/scripts/docker/README.md @@ -1,5 +1,5 @@ # Elektra Docker Artifacts -This folder contains all Docker related Artifacts. +This folder contains all Docker related artifacts. **Note:** Any commands in this file are expected to be run from the root @@ -23,7 +23,7 @@ You should also adjust the tag used via `-t` if you are building a different image. Please note that the complete images used to test Elektra are quite big -(~3.7GB) and take a some time (10min+) to build. +(~3.7GB) and take a some time (15min+) to build. ## Testing Elektra via Docker images To replicate errors on the test server you can build the image that ran the @@ -42,7 +42,15 @@ Note since we used matching userid + groupid to your current user the container will write to your mounted directory with the correct permissions. Once you are running inside the container you can use the same commands as you -would use normally to configure, compile and test Elektra. +would use normally to +[configure/compile](http://master.libelektra.org/doc/COMPILE.md) +and [test](http://master.libelektra.org/doc/TESTING.md) Elektra. +There is also some information on how the +[build server](http://master.libelektra.org/doc/BUILDSERVER.md) uses +the Docker images as well as the actual instructions executed by the +build server in our +[Jenkinsfiles](http://master.libelektra.org/scripts/jenkins). + ## Differences to the build server The build server does not create a bash shell inside the containers. @@ -52,5 +60,6 @@ open. Afterwards it executes each step via `docker exec`. There might be some more differences that might influence test outcomes. -One such documented case is #2008 and #1973 where errors on the test +One such documented case is [#2008](https://issues.libelektra.org/2008) and +[#1973](https://issues.libelektra.org/1973) where errors on the test server could not be replicated when running identical commands locally.