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

add simple gitlab-ci #299

Merged
merged 14 commits into from
Aug 13, 2019
62 changes: 62 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
include:
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v3/common.yml'

.projecttest:
extends: .test
variables:
OMPI_ALLOW_RUN_AS_ROOT: '1'
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: '1'
OMPI_MCA_btl_vader_single_copy_mechanism: 'none' # https://github.com/open-mpi/ompi/issues/4948
before_script:
- apt-get update
- apt-get install --yes --no-install-recommends ssh
- curl https://download.open-mpi.org/release/open-mpi/v${OPENMPI_VER}/openmpi-${OPENMPI_VER_FULL}.tar.gz --output openmpi.tar.gz
- tar xf openmpi.tar.gz
- patch -p1 -d openmpi-${OPENMPI_VER_FULL} < conf/ompi_rootenv.patch
- pushd openmpi-${OPENMPI_VER_FULL}
- ./configure --with-cuda --prefix=${HOME}/mpi
- make -j
- make install
- popd
script:
- export JULIA_MPI_PATH="${HOME}/mpi"
- ${JULIA_MPI_PATH}/bin/ompi_info
- julia -e 'using InteractiveUtils;
versioninfo()'
- julia --project -e 'using Pkg;
Pkg.build();
Pkg.test(coverage=true)'
.gputest:
extends: .projecttest
variables:
CI_IMAGE_TAG: 'cuda'
OPENMPI_VER: '4.0'
OPENMPI_VER_FULL: '4.0.1'
tags:
- cuda

gpu:test:dev:
extends: .gputest
variables:
CI_VERSION_TAG: 'dev'
allow_failure: true

gpu:test:v1.3:
extends: .gputest
variables:
CI_VERSION_TAG: 'v1.3'

gpu:test:v1.2:
extends: .gputest
variables:
CI_VERSION_TAG: 'v1.2'

gpu:test:v1.1:
extends: .gputest
variables:
CI_VERSION_TAG: 'v1.1'

gpu:test:v1.0:
extends: .gputest
variables:
CI_VERSION_TAG: 'v1.0'
29 changes: 29 additions & 0 deletions conf/ompi_rootenv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Allow override environment variables to work. This is required for running as root inside a docker container (e.g. Gitlab CI)

Upstream: https://github.com/open-mpi/ompi/pull/6895

--- a/orte/tools/orterun/orterun.c
+++ b/orte/tools/orterun/orterun.c
@@ -143,6 +143,14 @@ int orterun(int argc, char *argv[])
* exit with a giant warning flag
*/
if (0 == geteuid() && !orte_cmd_options.run_as_root) {
+ char *r1, *r2;
+ if (NULL != (r1 = getenv("OMPI_ALLOW_RUN_AS_ROOT")) &&
+ NULL != (r2 = getenv("OMPI_ALLOW_RUN_AS_ROOT_CONFIRM"))) {
+ if (0 == strcmp(r1, "1") && 0 == strcmp(r2, "1")) {
+ goto moveon;
+ }
+ }
+
fprintf(stderr, "--------------------------------------------------------------------------\n");
if (NULL != orte_cmd_options.help) {
fprintf(stderr, "%s cannot provide the help message when run as root.\n", orte_basename);
@@ -160,6 +168,7 @@ int orterun(int argc, char *argv[])
exit(1);
}

+ moveon:
/* setup to listen for commands sent specifically to me, even though I would probably
* be the one sending them! Unfortunately, since I am a participating daemon,
* there are times I need to send a command to "all daemons", and that means *I* have