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

Update Uberenv and introduce Gitlab CI [feature/uberenv_ci] #517

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
71a73cf
Changes in uberenv and adding Gitlab CI
adrienbernede Oct 29, 2019
9a27883
CI: Allowing failure for lassen builds
adrienbernede Feb 7, 2020
e4b6db6
Updating with uberenv master
adrienbernede Feb 6, 2020
8cf4de9
FIX: Small fix in uberenv
adrienbernede Feb 12, 2020
b93b301
Update uberenv, fix issue with testing mode
adrienbernede Feb 7, 2020
2339d75
Allowing no package in uberenv
adrienbernede Feb 10, 2020
74b614e
Copyright, timeout, spack version
adrienbernede Feb 11, 2020
f96f07d
Uberenv: workflow considerations
adrienbernede Feb 11, 2020
311ea7e
Clean up in gitlab
adrienbernede Mar 2, 2020
a995a09
Reformat gitlab yaml file for modular scripts
adrienbernede Mar 3, 2020
9be6ab4
Attempt to define jobs with uberenv update
adrienbernede Mar 3, 2020
4356ea8
Placing update_and_build jobs in a specific stage
adrienbernede Mar 3, 2020
264bd10
Attempt to split build and install
adrienbernede Mar 3, 2020
fe6ad69
CI: creating missing jobs + reformat
adrienbernede Mar 4, 2020
e7eb507
Uberenv: allow already installed project
adrienbernede Mar 3, 2020
891d6e6
Uberenv: Improved management of external commands outputs
adrienbernede Mar 4, 2020
dd344fc
Restrict spec in find_pkg and activation
adrienbernede Mar 10, 2020
f9fb17f
CI: prepare for trigger with specific uberenv ref
adrienbernede Mar 10, 2020
7fb760b
Simplified version of pipeline
adrienbernede Mar 10, 2020
c5fe1d2
Skip jobs that will fail
adrienbernede Mar 10, 2020
1274fc1
improved naming
adrienbernede Mar 11, 2020
e66a391
improved design
adrienbernede Mar 11, 2020
bacfb08
Fix in uberenv
adrienbernede Mar 11, 2020
6e7af0e
Minor changes in uberenv
adrienbernede Mar 12, 2020
270b4d8
Force new install of dependencies
adrienbernede Mar 12, 2020
cbae70e
Fix minor bug in uberenv: incorrect variable scope
adrienbernede Apr 21, 2020
ddf7bc1
Update uberenv
adrienbernede Apr 29, 2020
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
82 changes: 82 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
##############################################################################
# Copyright (c) 2014-20, Lawrence Livermore National Security, LLC and Conduit
# project contributors. See the COPYRIGHT file for details.
##############################################################################

variables:
GIT_SUBMODULE_STRATEGY: recursive
CONDUIT_ALLOC_NAME: conduit_${CI_PIPELINE_ID}
BUILD_ROOT: ${CI_BUILDS_DIR}/conduit/${CI_COMMIT_REF_SLUG}_${CI_PIPELINE_ID}
INSTALL_ROOT: ${CI_BUILDS_DIR}/conduit/${CI_COMMIT_REF_SLUG}_${CI_PIPELINE_ID}/uberenv_libs
SPACK_UPSTREAM: /usr/workspace/radiuss/spack-chain-parent/opt/spack

stages:
- allocate_resources
- deps
- install
- release_resources
- clean

#########
# SCRIPTS
#########

# Whether and how to update uberenv
.run_update_uberenv: &run_update_uberenv |
[[ -n "${UPDATE_UBERENV}" ]] && ./scripts/ci/update-uberenv.sh "${UPDATE_UBERENV}"

# How to build uberenv command
.def_uberenv_cmd: &def_uberenv_cmd |
INSTALL=""
[[ "${UBERENV_INSTALL}" == "ON" ]] && INSTALL="--install --run_tests"
mkdir -p ${INSTALL_ROOT}_${SYS_TYPE}_${TOOLCHAIN}
PREFIX="--prefix=${INSTALL_ROOT}_${SYS_TYPE}_${TOOLCHAIN}"
UPSTREAM="--upstream=${SPACK_UPSTREAM}"
SPEC="--spec=${PKG_SPEC}"
UBERENV_CMD="scripts/uberenv/uberenv.py ${INSTALL} ${SPEC} ${PREFIX} ${UPSTREAM}"

# Allocation sequence
.def_srun_prefix: &def_srun_prefix |
JOB_ID=$(squeue -h --name=${CONDUIT_ALLOC_NAME} --format=%A)
[[ -n "${JOB_ID}" ]] && JOB_ID="--jobid=${JOB_ID}"
RESOURCES="-N 1 -n 1 -c 12"
export SRUN_PREFIX="srun ${JOB_ID} ${RESOURCES}"

# Define the generic script for quartz (template)
.srun_build_script:
script:
- *run_update_uberenv
- *def_srun_prefix
- *def_uberenv_cmd
- set -x; ${SRUN_PREFIX} ${UBERENV_CMD}; set +x

# Define the generic script for lassen (template)
.lsf_build_script:
script:
- *run_update_uberenv
- *def_uberenv_cmd
- set -x; lalloc 1 ${UBERENV_CMD}; set +x

# Build modes templates:
# A job will have one on this template to pilot the behavior of def_uberenv_cmd
.mode_deps:
stage: deps
variables:
UBERENV_INSTALL: "OFF"

.mode_install:
stage: install
variables:
UBERENV_INSTALL: "ON"

##########
# INCLUDES
##########

# This is where templates and jobs are included
include:
- local: .gitlab/toolchains_templates.yml
- local: .gitlab/quartz_templates.yml
- local: .gitlab/quartz_jobs.yml
- local: .gitlab/lassen_templates.yml
- local: .gitlab/lassen_jobs.yml
21 changes: 21 additions & 0 deletions .gitlab/lassen_jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##############################################################################
# Copyright (c) 2016-2020, Lawrence Livermore National Security, LLC and
# Conduit project contributors. See the COPYRIGHT file for details.
#
# SPDX-License-Identifier: (MIT)
##############################################################################

# Here are all lassen build jobs
clang (build deps on lassen):
extends: [.build_deps_on_lassen, .with_clang]

clang (install on lassen):
extends: [.install_on_lassen, .with_clang]
needs: [clang (build deps on lassen)]

xl (build deps on lassen):
extends: [.build_deps_on_lassen, .with_xl]

xl (install on lassen):
extends: [.install_on_lassen, .with_xl]
needs: [xl (build deps on lassen)]
28 changes: 28 additions & 0 deletions .gitlab/lassen_templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
##############################################################################
# Copyright (c) 2014-20, Lawrence Livermore National Security, LLC and Conduit
# project contributors. See the COPYRIGHT file for details.
##############################################################################

##################
# LASSEN TEMPLATES
##################

# Shared configuration of jobs for lassen
.on_lassen:
variables:
tags:
- shell
- lassen
rules:
- if: '$CI_COMMIT_BRANCH =~/_lnone/ || $CONDUIT_CI_LASSEN == "OFF"'
when: never
- when: on_success
allow_failure: true

####
# Generic lassen jobs
.build_deps_on_lassen:
extends: [.lsf_build_script, .mode_deps, .on_lassen]

.install_on_lassen:
extends: [.lsf_build_script, .mode_install, .on_lassen]
38 changes: 38 additions & 0 deletions .gitlab/quartz_jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
##############################################################################
# Copyright (c) 2016-2020, Lawrence Livermore National Security, LLC and
# Conduit project contributors. See the COPYRIGHT file for details.
#
# SPDX-License-Identifier: (MIT)
##############################################################################

## In pre-build phase, allocate a node for builds
#allocate_resources_build_quartz:
# extends: .quartz_common
# stage: allocate_resources
# script:
# - salloc -N 1 -c 36 --no-shell --job-name=${CONDUIT_ALLOC_NAME}
#
## In post-build phase, deallocate resources
## Note : make sure this is run even on build phase failure
#release_resources_build_quartz:
# extends: .quartz_common
# stage: release_resources
# script:
# - export JOBID=$(squeue -h --name=${CONDUIT_ALLOC_NAME} --format=%A)
# - ([[ -n "${JOBID}" ]] && scancel ${JOBID})
# when: always

# Here are all quartz build jobs
gcc (build deps on quartz):
extends: [.build_deps_on_quartz, .with_gcc]

gcc (install on quartz):
extends: [.install_on_quartz, .with_gcc]
needs: [gcc (build deps on quartz)]

gcc_static (build deps on quartz):
extends: [.build_deps_on_quartz, .with_gcc_static]

gcc_static (install on quartz):
extends: [.install_on_quartz, .with_gcc_static]
needs: [gcc_static (build deps on quartz)]
28 changes: 28 additions & 0 deletions .gitlab/quartz_templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
##############################################################################
# Copyright (c) 2014-20, Lawrence Livermore National Security, LLC and Conduit
# project contributors. See the COPYRIGHT file for details.
##############################################################################

##################
# QUARTZ TEMPLATES
##################

# Shared configuration of jobs for quartz
.on_quartz:
tags:
- shell
- quartz
timeout: 3h
except:
refs:
- /_qnone/
variables:
- $CONDUIT_CI_QUARTZ == "OFF"

####
# Generic qwartz jobs
.build_deps_on_quartz:
extends: [.srun_build_script, .mode_deps, .on_quartz]

.install_on_quartz:
extends: [.srun_build_script, .mode_install, .on_quartz]
28 changes: 28 additions & 0 deletions .gitlab/toolchains_templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
##############################################################################
# Copyright (c) 2014-20, Lawrence Livermore National Security, LLC and Conduit
# project contributors. See the COPYRIGHT file for details.
##############################################################################

############
# TOOLCHAINS
############

.with_gcc:
variables:
TOOLCHAIN: "gcc"
PKG_SPEC: ""

.with_gcc_static:
variables:
TOOLCHAIN: "gcc_static"
PKG_SPEC: "%gcc~shared"

.with_clang:
variables:
TOOLCHAIN: "clang"
PKG_SPEC: "%clang@coral~python~fortran"

.with_xl:
variables:
TOOLCHAIN: "xl"
PKG_SPEC: "%xl@coral~shared~python~fortran"
13 changes: 13 additions & 0 deletions scripts/ci/update-uberenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if [[ ! ${1} ]]
then
echo "ERROR: expecting reference for uberenv repo" >&2
else
uberenv_ref="${1}"
fi

uberenv_file="scripts/uberenv/uberenv.py"
uberenv_master="https://raw.githubusercontent.com/LLNL/uberenv/${uberenv_ref}/uberenv.py"

curl --fail --output ${uberenv_file} ${uberenv_master}
87 changes: 0 additions & 87 deletions scripts/uberenv/packages/uberenv-conduit/package.py

This file was deleted.

Binary file not shown.
12 changes: 7 additions & 5 deletions scripts/uberenv/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"package_name" : "conduit",
"uberenv_package_name" : "uberenv-conduit",
"spack_url": "https://github.com/alpine-DAV/spack",
"spack_branch": "task/2019_10_update_conduit",
"spack_activate" : {"py-numpy" : ["+python"],
"py-sphinx": ["+python","+doc"],
"package_version" : "master",
"package_final_phase" : "configure",
"package_source_dir" : "../..",
"spack_url": "https://github.com/spack/spack",
"spack_branch": "develop",
"spack_activate" : {"py-numpy" : ["+python"],
"py-sphinx": ["+python","+doc"],
"py-mpi4py" : ["+python", "+mpi"],
"py-sphinx-rtd-theme": ["+python","+doc"] }
}
Loading