Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Centos7 packages #5

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ generate-pipeline:
artifacts:
paths:
- "${CI_PROJECT_DIR}/jobs_scratch_dir/pipeline.yml"
image: { "name": "spack/ubuntu-bionic", "entrypoint": [""] }
image: { "name": "scottwittenburg/amazonlinux-builder", "entrypoint": [""] }
tags: ["spack-kube", "medium"]

build-jobs:
Expand Down
44 changes: 36 additions & 8 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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.
21 changes: 10 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ 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++ \
g++-4.8 \
g++-6 \
gcc \
gcc-4.8 \
gcc-6 \
gfortran \
gfortran-4.8 \
gfortran-6 \
git \
gnupg2 \
iproute2 \
Expand All @@ -37,22 +38,20 @@ 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/build_cache

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 && \
mkdir -p /mirror/build_cache && \
aws s3 sync ${REMOTE_BUILDCACHE_URL} /mirror && \
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"]

37 changes: 37 additions & 0 deletions docker/amazonlinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM amazonlinux:2
MAINTAINER Spack Maintainers <[email protected]>

RUN yum update -y \
&& yum groupinstall -y "Development Tools" \
&& yum install -y \
curl \
findutils \
gcc-c++ \
gcc \
gcc-gfortran \
git \
gnupg2 \
hostname \
iproute \
Lmod \
make \
patch \
procps \
python3 \
python3-pip \
python3-setuptools \
tcl \
unzip \
vim \
which \
&& pip3 install boto3 \
&& rm -rf /var/cache/yum \
&& yum clean all

# [WORKAROUND]
# https://superuser.com/questions/1241548/
# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889
RUN [ -f ~/.profile ] \
&& sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \
|| true

4 changes: 4 additions & 0 deletions docker/packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages:
all:
target: [x86_64]

26 changes: 13 additions & 13 deletions docker/tutorial-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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@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
Expand All @@ -51,24 +51,24 @@ 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

# 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
Expand Down
28 changes: 14 additions & 14 deletions spack.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
spack:
definitions:
- bootstrapped_compilers:
- "[email protected] os=ubuntu18.04"
- "[email protected] os=ubuntu18.04"
- "[email protected] os=ubuntu18.04"
- "[email protected] os=amzn2"
- "[email protected] os=amzn2"
- "[email protected] os=amzn2"
- gcc_system_packages:
- matrix:
- - zlib
Expand All @@ -19,7 +19,7 @@ spack:
- [email protected]
- mpileaks
- lmod
- ['%gcc@7.5.0']
- ['%gcc@7.3.1']
- gcc_old_packages:
- zlib%[email protected]
- clang_packages:
Expand All @@ -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-amazonlinux'

gitlab-ci:
bootstrap:
Expand All @@ -52,46 +52,46 @@ spack:
- match: [llvm]
runner-attributes:
image:
name: spack/ubuntu-bionic
name: scottwittenburg/amazonlinux-builder
entrypoint: ['']
tags: [spack-kube, r5.2xlarge]
variables: {}
- match: [trilinos, gcc]
runner-attributes:
image:
name: spack/ubuntu-bionic
name: scottwittenburg/amazonlinux-builder
entrypoint: ['']
tags: [spack-kube, large]
variables: {}
- match: [os=ubuntu18.04]
- match: [os=amzn2]
runner-attributes:
image:
name: spack/ubuntu-bionic
name: scottwittenburg/amazonlinux-builder
entrypoint: ['']
tags: [spack-kube, medium]
variables: {}
final-stage-rebuild-index:
tags: [spack-kube]
image:
name: spack/ubuntu-bionic
name: scottwittenburg/amazonlinux-builder
entrypoint: ['']
enable-debug-messages: True

cdash:
build-group: Spack v0.15.1 Tutorial Container
build-group: Spack v0.15.1 (amzn2) Tutorial Container
url: https://cdash.spack.io
project: Spack
site: Spack Gitlab Cloud Infrastructure

view: false
config: {}
config:
install_tree: /home/software/$padding:512
modules:
enable: []
packages:
suite-sparse:
version: [5.3.0, 5.4.0, 5.5.0, 5.6.0]
all:
target: [x86_64]
repos: []
upstreams: {}
concretization: separately