From e76e029a09a2c875d3740e9f748cab779b006cb8 Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Fri, 17 Jul 2020 14:59:49 -0600 Subject: [PATCH 1/5] Replace gcc@4.8 w/ gcc@7.5.0, gcc@7.2.0 w/ gcc@8.3.0, update release version --- docker/Dockerfile | 3 --- docker/tutorial-test.sh | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1d2ab76..f2dbc8a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,11 +14,8 @@ RUN apt-get update -y && \ clang-3.7 \ emacs \ g++ \ - g++-4.8 \ gcc \ - gcc-4.8 \ gfortran \ - gfortran-4.8 \ git \ gnupg2 \ iproute2 \ diff --git a/docker/tutorial-test.sh b/docker/tutorial-test.sh index 14f8d00..2bac326 100755 --- a/docker/tutorial-test.sh +++ b/docker/tutorial-test.sh @@ -15,7 +15,7 @@ rm -rf ~/.spack/* # clone a new spack git clone https://github.com/spack/spack cd spack -git checkout releases/v0.12 +git checkout releases/v0.15 # shell init . share/spack/setup-env.sh @@ -28,13 +28,13 @@ spack mirror add tutorial /mirror spack gpg trust /mirror/public.key spack install zlib %clang spack install zlib @1.2.8 -spack install zlib %gcc@4.8 +spack install zlib %gcc@7.5.0 spack install zlib @1.2.8 cppflags=-O3 spack find spack find -lf spack install tcl spack install tcl ^zlib @1.2.8 %clang -spack install tcl ^/64mn +spack install tcl ^/64mn spack find -ldf spack install hdf5 spack install hdf5~mpi @@ -51,10 +51,10 @@ spack find -lf zlib spack find ^mpich spack find cppflags=-O3 spack find -px -spack install gcc@7.2.0 +spack install gcc@8.3.0 spack find -p gcc -spack compiler add `spack location -i gcc@7.2.0` -spack compiler remove gcc@7.2.0 +spack compiler add `spack location -i gcc@8.3.0` +spack compiler remove gcc@8.3.0 # Packagin spack install mpileaks @@ -62,13 +62,13 @@ spack install mpileaks # Modules spack install lmod source `spack location -i lmod`/lmod/7.8/init/bash -spack compiler add `spack location -i gcc@7.2.0` -spack install netlib-scalapack ^openmpi ^openblas %gcc@7.2.0 -spack install netlib-scalapack ^openmpi ^netlib-lapack %gcc@7.2.0 -spack install netlib-scalapack ^mpich ^openblas %gcc@7.2.0 -spack install netlib-scalapack ^mpich ^netlib-lapack %gcc@7.2.0 -spack install py-scipy ^openblas %gcc@7.2.0 -spack compiler remove gcc@7.2.0 +spack compiler add `spack location -i gcc@8.3.0` +spack install netlib-scalapack ^openmpi ^openblas %gcc@8.3.0 +spack install netlib-scalapack ^openmpi ^netlib-lapack %gcc@8.3.0 +spack install netlib-scalapack ^mpich ^openblas %gcc@8.3.0 +spack install netlib-scalapack ^mpich ^netlib-lapack %gcc@8.3.0 +spack install py-scipy ^openblas %gcc@8.3.0 +spack compiler remove gcc@8.3.0 # Advanced packaging spack install netlib-lapack From 5d8b4ab04955a5e4e2edbf3f256154672540c6fe Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Fri, 17 Jul 2020 15:01:43 -0600 Subject: [PATCH 2/5] Use previous mirror url so docker build var does not need to be updated --- spack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack.yaml b/spack.yaml index 94e1d07..7b365cd 100644 --- a/spack.yaml +++ b/spack.yaml @@ -42,7 +42,7 @@ spack: - $gcc_spack_built_packages mirrors: - cloud_mirror: 's3://spack-tutorial-container/mirror-v0.15.1' + cloud_mirror: 's3://spack-tutorial-container/mirror' gitlab-ci: bootstrap: From 9f93a449f2aa2b4af1ad7bb7c7d5b3598509b194 Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Mon, 20 Jul 2020 15:05:56 -0600 Subject: [PATCH 3/5] Update system compilers and test script, remove suite-sparse constraints --- docker/Dockerfile | 12 ++++++++---- docker/packages.yaml | 4 ++++ docker/tutorial-test.sh | 4 ++-- spack.yaml | 2 -- 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 docker/packages.yaml diff --git a/docker/Dockerfile b/docker/Dockerfile index f2dbc8a..3952548 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,9 +13,13 @@ RUN apt-get update -y && \ clang \ clang-3.7 \ emacs \ + file \ g++ \ + g++-6 \ gcc \ + gcc-6 \ gfortran \ + gfortran-6 \ git \ gnupg2 \ iproute2 \ @@ -35,21 +39,21 @@ RUN apt-get update -y && \ apt-get clean RUN mkdir -p /mirror/build_cache && \ - aws s3 sync ${REMOTE_BUILDCACHE_URL} /mirror/build_cache + aws s3 sync ${REMOTE_BUILDCACHE_URL} /mirror COPY /public.key /mirror/public.key -# COPY /packages.yaml /etc/spack/packages.yaml +COPY /packages.yaml /etc/spack/packages.yaml COPY /tutorial-test.sh /tutorial/.test/tutorial-test.sh ### TODO: Find another way to set perms without increasing the image download size RUN useradd -ms /bin/bash spack && \ chmod -R go+r /mirror && \ -# chmod -R go+r /etc/spack && \ + chmod -R go+r /etc/spack && \ chmod go+rx /tutorial/.test/tutorial-test.sh USER spack WORKDIR /home/spack -CMD ["bash"]i +CMD ["bash"] diff --git a/docker/packages.yaml b/docker/packages.yaml new file mode 100644 index 0000000..bc3c4d3 --- /dev/null +++ b/docker/packages.yaml @@ -0,0 +1,4 @@ +packages: + all: + target: [x86_64] + diff --git a/docker/tutorial-test.sh b/docker/tutorial-test.sh index 2bac326..277331d 100755 --- a/docker/tutorial-test.sh +++ b/docker/tutorial-test.sh @@ -28,13 +28,13 @@ spack mirror add tutorial /mirror spack gpg trust /mirror/public.key spack install zlib %clang spack install zlib @1.2.8 -spack install zlib %gcc@7.5.0 +spack install zlib %gcc@6.5.0 spack install zlib @1.2.8 cppflags=-O3 spack find spack find -lf spack install tcl spack install tcl ^zlib @1.2.8 %clang -spack install tcl ^/64mn +spack install tcl ^/h6i5 spack find -ldf spack install hdf5 spack install hdf5~mpi diff --git a/spack.yaml b/spack.yaml index 7b365cd..a68bd4d 100644 --- a/spack.yaml +++ b/spack.yaml @@ -88,8 +88,6 @@ spack: modules: enable: [] packages: - suite-sparse: - version: [5.3.0, 5.4.0, 5.5.0, 5.6.0] all: target: [x86_64] repos: [] From d24d83d5306a902c8cd08b0ff117a4af9fb9cb1c Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Mon, 20 Jul 2020 18:35:09 -0600 Subject: [PATCH 4/5] Add to UPDATING.md, remove unused clang, add build-essential --- UPDATING.md | 44 ++++++++++++++++++++++++++++++++++++-------- docker/Dockerfile | 2 +- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/UPDATING.md b/UPDATING.md index 76b7839..196a1a7 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -12,11 +12,11 @@ There are two build rules (see this [section](./DOCKERHUB_SETUP.md#configure-bui for more info) governing when DockerHub will rebuild the container. The first specifies that any time you push to the `master` branch on this repo, DockerHub will build an image and tag it with `latest`. The second build rull -specifies that any time you push a tag matching the regular expression +specifies that any time you push a branch matching the regular expression `^rev-(.+)$`, DockerHub will build an image and use the matched group -(everything in the tag following the `rev-`) to tag the image. So if, for -example, you want a container to be tagged `sc20`, you would tag this -repository `rev-sc20` and push it. +(everything in the branch name following the `rev-`) to tag the image. So if, +for example, you want a container to be tagged `sc20`, you would push a branch +to this repository named `rev-sc20`. ## Steps to build an updated container @@ -36,12 +36,15 @@ the helper script, run the following command from the root of the repository: $ ./keyhelp/export_pipeline_key.sh ./docker "name-of-key-to-export" -1. Create a new mirror (this is required until the sync process between the -mirror and the container build cache is controlled by/limited to the spack -environment in which it runs). The mirror url currently needs to be updated +1. Either a) create a new mirror, or else b) clean out the existing one. This +is required until the sync process between the mirror and the container build +cache is controlled by/limited to the spack environment in which it runs). If +you choose to create a new mirror, the mirror url currently needs to be updated in two locations: The `spack.yaml` and the DockerHub autobuild environment variables (see [here](./DOCKERHUB_SETUP.md#configure-builds) for more -information). +information). If you choose to clean out the old mirror, just use the web +interface to remove the entire "build_cache" directory, and then there is +nothing else to change. 1. Create a new buildgroup in CDash to track the builds from the version to be (done by editing the `spack.yaml` and changing the `build-group` property) @@ -54,3 +57,28 @@ the packages build. 1. Merge the PR into master and/or tag the result using the tagging scheme described in the section above. + +## Items that may require updates as OS/Spack version change + +Check what version of `gcc` gets installed by `apt-get` by default if you +don't specify a version. That should be the compiler the tutorial picks +to install most packages. Then an older `gcc` should be installed and used +to install zlib with the "custom" system compiler. If either of those +compilers aren't in the image used to build the pipeline, they need to +be bootstrapped in the `spack.yaml`. Then a newer `gcc` should also be +added to the `spack.yaml` and used for the demonstration of installing +a `gcc` with spack (and building all the packages with it in the subsequent +steps). That compiler will need to be bootstrapped as well. + +Check if `tcl` is still a 1-dependency package, if it's not, it should +be replaced with one. + +Check the hash of: `spack spec zlib @1.2.8 cppflags=-O3`, that hash should +be used in the line that installs `tcl` with a specific `zlib` dependency. + +Check the version of `clang` we get with `apt-get install clang`. If it is +no longer clang-6.0.0, then update the version of clang we bootstrap +in the `spack.yaml` and the packages that built against clang to match. + +Make sure to update the release branch of spack checked out in the +tutorial script. diff --git a/docker/Dockerfile b/docker/Dockerfile index 3952548..8477536 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,10 +8,10 @@ ARG AWS_SECRET_ACCESS_KEY="None" RUN apt-get update -y && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ autoconf \ + build-essential \ ca-certificates \ curl \ clang \ - clang-3.7 \ emacs \ file \ g++ \ From fae46e0d8070b3d52ba713a297bf15e2dace4cba Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Mon, 20 Jul 2020 18:52:01 -0600 Subject: [PATCH 5/5] chmod -R /mirror in the same layer where it is created --- docker/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8477536..6f6079c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -38,15 +38,13 @@ RUN apt-get update -y && \ apt-get autoremove --purge && \ apt-get clean -RUN mkdir -p /mirror/build_cache && \ - aws s3 sync ${REMOTE_BUILDCACHE_URL} /mirror - COPY /public.key /mirror/public.key COPY /packages.yaml /etc/spack/packages.yaml COPY /tutorial-test.sh /tutorial/.test/tutorial-test.sh -### TODO: Find another way to set perms without increasing the image download size RUN useradd -ms /bin/bash spack && \ + mkdir -p /mirror/build_cache && \ + aws s3 sync ${REMOTE_BUILDCACHE_URL} /mirror && \ chmod -R go+r /mirror && \ chmod -R go+r /etc/spack && \ chmod go+rx /tutorial/.test/tutorial-test.sh