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

support for multiple CVMFS repositories in eessi_container.sh #618

Conversation

trz42
Copy link
Collaborator

@trz42 trz42 commented Jun 17, 2024

Support for multiple CVMFS repositories is needed for dev.eessi.io.

Ready for review. Example test:

# ./eessi_container.sh --repository software.eessi.io --repository dev.eessi.io,access=rw
Using /tmp/eessi.jLuBerqoFu as tmp directory (to resume session add '--resume /tmp/eessi.jLuBerqoFu').
Pulling container image from docker://ghcr.io/eessi/build-node:debian11 to /tmp/eessi.jLuBerqoFu/ghcr.io_eessi_build_node_debian11.sif
Launching container with command (next line):
singularity -q shell  --fusemount container:cvmfs2 cvmfs-config.cern.ch /cvmfs/cvmfs-config.cern.ch --fusemount container:cvmfs2 software.eessi.io /cvmfs/software.eessi.io --fusemount container:cvmfs2 dev.eessi.io /cvmfs_ro/dev.eessi.io --fusemount container:fuse-overlayfs -o lowerdir=/cvmfs_ro/dev.eessi.io -o upperdir=/tmp/dev.eessi.io/overlay-upper -o workdir=/tmp/dev.eessi.io/overlay-work /cvmfs/dev.eessi.io /tmp/eessi.jLuBerqoFu/ghcr.io_eessi_build_node_debian11.sif
INFO:    Environment variable SINGULARITY_BIND is set, but APPTAINER_BIND is preferred
INFO:    Environment variable SINGULARITY_HOME is set, but APPTAINER_HOME is preferred
CernVM-FS: pre-mounted on file descriptor 3
CernVM-FS: pre-mounted on file descriptor 3
CernVM-FS: pre-mounted on file descriptor 3
Apptainer> CernVM-FS: loading Fuse module... done
CernVM-FS: loading Fuse module... CernVM-FS: loading Fuse module... done
done

Apptainer> touch /cvmfs/dev.eessi.io/foo
Apptainer> touch /cvmfs/software.eessi.io/foo
touch: cannot touch '/cvmfs/software.eessi.io/foo': Permission denied

Partially fixes #616 (doesn't provide repository-specific bind mounts for host_injections).

@trz42 trz42 added the enhancement New feature or request label Jun 17, 2024
Copy link

eessi-bot bot commented Jun 17, 2024

Instance eessi-bot-mc-aws is configured to build for:

  • architectures: x86_64/generic, x86_64/intel/haswell, x86_64/intel/skylake_avx512, x86_64/amd/zen2, x86_64/amd/zen3, aarch64/generic, aarch64/neoverse_n1, aarch64/neoverse_v1
  • repositories: eessi.io-2023.06-compat, eessi-hpc.org-2023.06-software, eessi-hpc.org-2023.06-compat, eessi.io-2023.06-software

Copy link

eessi-bot bot commented Jun 17, 2024

Instance eessi-bot-mc-azure is configured to build for:

  • architectures: x86_64/amd/zen4
  • repositories: eessi.io-2023.06-software, eessi-hpc.org-2023.06-compat, eessi-hpc.org-2023.06-software, eessi.io-2023.06-compat

@trz42 trz42 marked this pull request as draft June 17, 2024 13:12
@trz42 trz42 marked this pull request as ready for review June 19, 2024 14:09
@trz42 trz42 changed the title [WIP] support for multiple CVMFS repositories in eessi_container.sh support for multiple CVMFS repositories in eessi_container.sh Jun 19, 2024
@Neves-P
Copy link
Member

Neves-P commented Jun 27, 2024

Tried the container with @trz42's instructions from slack

# Step 1: checkout repo (and PR)
git clone https://github.com/EESSI/software-layer
cd software-layer
git fetch origin pull/618/head:PR618
git checkout PR618
# Step 2: launch interactive job, for example
srun --time=60 --pty bash
# Step 3: launch container with read access to software.eessi.io and write access to dev.eessi.io
./eessi_container.sh -r software.eessi.io -r dev.eessi.io,access=rw
# Step 4: init EESSI and build environment
source /cvmfs/software.eessi.io/versions/2023.06/init/bash
export EESSI_PROJECT_INSTALL=/cvmfs/dev.eessi.io/dev_test/versions/2023.06/software/linux/${EESSI_SOFTWARE_SUBDIR}
module load EESSI-extend/2023.06-easybuild
# Step 5: build some software (e.g., recently merged imbalanced-learn-0.12.3-gfbf-2023a.eb)
eb --robot --from-pr 20848 imbalanced-learn-0.12.3-gfbf-2023a.eb
# Step 6: show, load and test module
module show imbalanced-learn/0.12.3-gfbf-2023a
module load imbalanced-learn/0.12.3-gfbf-2023a
python -c "import imblearn"

Works out of the box! The only thing extra I had to do was: mkdir -p /cvmfs/dev.eessi.io/dev_test/versions/2023.06/software/linux/${EESSI_SOFTWARE_SUBDIR}.

Otherwise I get:

{EESSI 2023.06} Apptainer> module load EESSI-extend/2023.06-easybuild
-- Using /tmp/$USER as a temporary working directory for installations, you can override this by setting the
environment variable WORKING_DIR and reloading the module (e.g., /dev/shm is a common option)
Lmod has detected the following error:  The location of EESSI_PROJECT_INSTALL
(/cvmfs/dev.eessi.io/dev_test/versions/2023.06/software/linux/aarch64/neoverse_v1) does not exist or is not a folder
While processing the following module(s):
    Module fullname                 Module Filename
    ---------------                 ---------------
    EESSI-extend/2023.06-easybuild  /cvmfs/software.eessi.io/versions/2023.06/software/linux/aarch64/neoverse_v1/modules/all/EESSI-extend/2023.06-easybuild.lua

Once I first created the directory then I was able to load EESSI-extend in such a way that newly installed modules would land in dev.eessi.io, which is the intended behaviour.

I might be missing a step, but if not perhaps there is a way to take care of creating the necessary subdirectories automatically (i.e., cvmfs/somerepo/right_path/${EESSI_SOFTWARE_SUBDIR}?

Neves-P
Neves-P previously approved these changes Jun 27, 2024
Copy link
Member

@Neves-P Neves-P left a comment

Choose a reason for hiding this comment

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

Quoting my message from slack:

I can't see anything wrong in the code, but it might be a good idea to have someone who is more familiar with setting up CVMFS repositories than I am to also take a look since some changes may have implications that I'm not aware of. Beyond that, looks good to me, and works!

eessi_container.sh Outdated Show resolved Hide resolved
eessi_container.sh Outdated Show resolved Hide resolved
bedroge
bedroge previously approved these changes Jul 4, 2024
Copy link
Collaborator

@bedroge bedroge left a comment

Choose a reason for hiding this comment

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

Looks good to me. Tested it with various scenarios, and it worked like a charm!

Neves-P
Neves-P previously approved these changes Jul 4, 2024
Copy link
Member

@Neves-P Neves-P left a comment

Choose a reason for hiding this comment

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

LGTM!

@bedroge bedroge dismissed stale reviews from Neves-P and themself via aa9895e July 4, 2024 13:28
@bedroge
Copy link
Collaborator

bedroge commented Jul 4, 2024

The "tests for eessi_container.sh script / eessi_container_script (listrepos_custom)" CI was actually already broken: it was configuring a "EESSI/20AB.CD" and "EESSI/20HT.TP", but then running a grep for ""[EESSI/2023.02]". Not only is that version not available, also the regex itself is wrong: the square brackets should have been escaped, otherwise they will just try to match any of those characters. Because of the wrong regex, the check still passed with this wrong EESSI version.

I've fixed it in aa9895e. Also, the other check now doesn't look for "EESSI" anymore (which used to be the default repo name), but instead for "software.eessi.io". This was needed because of the changes in this PR.

Copy link
Member

@Neves-P Neves-P left a comment

Choose a reason for hiding this comment

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

Regex is fixed and the CI passed without issues 🎉

@Neves-P Neves-P merged commit a9b4233 into EESSI:2023.06-software.eessi.io Jul 4, 2024
34 checks passed
BIND_PATHS="${BIND_PATHS},${EESSI_TMPDIR}/repos_cfg/${src}:${target}"
done
export EESSI_VERSION_OVERRIDE=${repo_version}
export EESSI_CVMFS_REPO_OVERRIDE="/cvmfs/${repo_name}"
Copy link
Contributor

@boegel boegel Jul 4, 2024

Choose a reason for hiding this comment

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

Seems like this was important, it shouldn't have been removed.

I'm now seeing errors like this in the build job for #632:

ERROR: software.eessi.io/versions/2023.06/compat/linux/aarch64 does not exist!

Note the missing /cvmfs/...

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe we're missing a fix in bot/build.sh, which now has this:

export EESSI_CVMFS_REPO_OVERRIDE=$(cfg_get_value "repository" "repo_name")

I guess this should be:

export EESSI_CVMFS_REPO_OVERRIDE=/cvmfs/$(cfg_get_value "repository" "repo_name")

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, yes, good catch, looks like that needs to be changed (and I think it makes more sense that these things are (only) set there and not in the container script).

Copy link
Contributor

@boegel boegel Jul 4, 2024

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dev.eessi.io] enable eessi_container.sh to mount several CVMFS repos with individual access mode
5 participants