Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.admin
Commits
f7403602
Commit
f7403602
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
install conda on mac
parent
6b8511ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!63
Conda package based CI
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
gitlab/build.sh
+1
-1
1 addition, 1 deletion
gitlab/build.sh
gitlab/deploy.sh
+2
-1
2 additions, 1 deletion
gitlab/deploy.sh
gitlab/functions.sh
+43
-0
43 additions, 0 deletions
gitlab/functions.sh
templates/gitlab-ci.yml
+31
-10
31 additions, 10 deletions
templates/gitlab-ci.yml
with
77 additions
and
12 deletions
gitlab/build.sh
+
1
−
1
View file @
f7403602
...
...
@@ -4,7 +4,7 @@
source
$(
dirname
${
0
}
)
/functions.sh
run_cmd
${
CONDA_FOLDER
}
/bin/conda
install
-n
root
--yes
--quiet
conda
=
4 conda-build
=
3
run_cmd
${
CONDA_FOLDER
}
/bin/conda config
--set
always_yes
true
run_cmd
${
CONDA_FOLDER
}
/bin/conda config
--set
always_yes
yes
--set
changeps1 no
run_cmd
${
CONDA_FOLDER
}
/bin/conda config
--set
show_channel_urls
true
run_cmd
${
CONDA_FOLDER
}
/bin/conda clean
--lock
run_cmd
cp
_ci/conda_build_config.yaml conda/
...
...
This diff is collapsed.
Click to expand it.
gitlab/deploy.sh
+
2
−
1
View file @
f7403602
...
...
@@ -5,7 +5,7 @@ source $(dirname ${0})/functions.sh
# Uploads all the built packages
for
os
in
"osx-64"
"noarch"
"linux-64"
;
do
for
f
in
conda-env
/
${
os
}
/
*
.tar.bz2
;
do
for
f
in
${
CONDA_BLD_PATH
}
/
${
os
}
/
*
.tar.bz2
;
do
if
[[
-f
$f
]]
;
then
if
[
-z
"
${
CI_COMMIT_TAG
}
"
]
;
then
#beta
url
=
"private"
...
...
@@ -17,6 +17,7 @@ for os in "osx-64" "noarch" "linux-64"; do
done
done
# If a package does not build for Linux, $f does not exist.
# Uploads docs for the last treated package
run_cmd
tar
xvfj
"
${
f
}
"
docs/
${
CI_PROJECT_NAME
}
...
...
This diff is collapsed.
Click to expand it.
gitlab/functions.sh
+
43
−
0
View file @
f7403602
...
...
@@ -263,6 +263,44 @@ if [ -z "${BOB_PACKAGE_VERSION}" ]; then
BOB_PACKAGE_VERSION
=
`
cat
version.txt |
tr
-d
'\n'
`
;
fi
# installs a miniconda installation.
# $1: Path to where to install miniconda. The path should not exist.
install_miniconda
()
{
log_info
"Installing miniconda in
${
1
}
..."
# Download the latest conda installation script
if
[
"
${
OSNAME
}
"
==
"macosx"
]
;
then
object
=
https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
else
object
=
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
fi
# check if miniconda.sh exists
if
[
!
-e
miniconda.sh
]
;
then
log_info
"Downloading latest miniconda3 installer..."
run_cmd curl
--silent
--output
miniconda.sh
${
object
}
else
log_info
"Re-using cached miniconda3 installer..."
ls
-l
miniconda.sh
fi
# Check if cache exists and save urls.txt to create a valid cache after conda
# installation override
_urls
=
"
${
1
}
/pkgs/urls.txt"
if
[
-e
${
_urls
}
]
;
then
run_cmd
cp
${
_urls
}
${
_urls
}
.cached
fi
bash miniconda.sh
-b
-p
${
1
}
# Reset urls.txt
if
[
-e
${
_urls
}
.cached
]
;
then
log_info
"Merging urls.txt files with cached values..."
cat
${
_urls
}
${
_urls
}
.cached |
sort
|
uniq
>
${
_urls
}
fi
# List currently available packages on cache
run_cmd
ls
-l
${
1
}
/pkgs/
run_cmd
cat
${
1
}
/pkgs/urls.txt
hash
-r
}
check_env PYTHON_VERSION
check_env CI_PROJECT_URL
check_env CI_PROJECT_DIR
...
...
@@ -284,6 +322,11 @@ if [ -z "${CONDA_FOLDER}" ]; then
CONDA_FOLDER
=
/opt/miniconda
fi
# check if a conda installation exists. Otherwise, install one:
if
[
!
-e
$1
]
;
then
install_miniconda
${
CONDA_FOLDER
}
fi
PYVER
=
py
$(
echo
${
PYTHON_VERSION
}
|
tr
-d
'.'
)
if
[
-z
"
${
DOCSERVER
}
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
templates/gitlab-ci.yml
+
31
−
10
View file @
f7403602
# This build file uses template features from YAML so it is generic enough for
# any Bob project. Don't modify it unless you know what you're doing.
# global variables
variables
:
CONDA_ENVS_PATH
:
"
conda-env"
CONDA_BLD_PATH
:
"
conda-env"
# Definition of our build pipeline order
stages
:
...
...
@@ -12,7 +17,13 @@ stages:
# Build targets
.build_template
:
&build_job
stage
:
build
script
:
-
./_ci/build.sh
.build_linux_template
:
&linux_build_job
<<
:
*build_job
before_script
:
-
export CONDA_FOLDER=/opt/miniconda
-
export PATH=/opt/miniconda/bin:$PATH
-
mkdir _ci
-
curl https://curl.haxx.se/ca/cacert.pem > _ci/cacert.pem
...
...
@@ -21,34 +32,44 @@ stages:
-
curl "https://gitlab.idiap.ch/bob/bob.admin/raw/condapackage/gitlab/install.sh" > _ci/install.sh
-
chmod 755 _ci/install.sh
-
./_ci/install.sh _ci condapackage
script
:
-
./_ci/build.sh
.build_linux_template
:
&linux_build_job
<<
:
*build_job
artifacts
:
expire_in
:
1 week
paths
:
-
_ci/
-
conda-env
/linux-64/*.tar.bz2
-
${CONDA_ENVS_PATH}
/linux-64/*.tar.bz2
tags
:
-
docker
image
:
continuumio/conda_builder_linux
cache
:
key
:
"
$CI_JOB_NAME"
paths
:
-
conda-env
/.pkgs/*.tar.bz2
-
conda-env
/.pkgs/urls.txt
-
${CONDA_ENVS_PATH}
/.pkgs/*.tar.bz2
-
${CONDA_ENVS_PATH}
/.pkgs/urls.txt
.build_macosx_template
:
&macosx_build_job
<<
:
*build_job
before_script
:
-
export CONDA_FOLDER=$CI_PROJECT_DIR/${CONDA_ENVS_PATH}
-
export PATH=$CI_PROJECT_DIR/${CONDA_ENVS_PATH}/bin:$PATH
-
mkdir _ci
-
curl https://curl.haxx.se/ca/cacert.pem > _ci/cacert.pem
-
export CURL_CA_BUNDLE=`pwd`/_ci/cacert.pem
-
export SSL_CERT_FILE=`pwd`/_ci/cacert.pem
-
curl "https://gitlab.idiap.ch/bob/bob.admin/raw/condapackage/gitlab/install.sh" > _ci/install.sh
-
chmod 755 _ci/install.sh
-
./_ci/install.sh _ci condapackage
artifacts
:
expire_in
:
1 week
paths
:
-
_ci/
-
conda-env
/osx-64/*.tar.bz2
-
${CONDA_ENVS_PATH}
/osx-64/*.tar.bz2
tags
:
-
conda-macosx
cache
:
key
:
"
$CI_JOB_NAME"
paths
:
-
miniconda.sh
-
${CONDA_ENVS_PATH}/pkgs/
build_linux_27
:
...
...
@@ -71,7 +92,7 @@ build_linux_36:
paths
:
-
_ci/
-
dist/
-
conda-env
/linux-64/*.tar.bz2
-
${CONDA_ENVS_PATH}
/linux-64/*.tar.bz2
build_macosx_27
:
<<
:
*macosx_build_job
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment