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
0b687ae2
Commit
0b687ae2
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Upload old bootstrap snippet into the package
parent
c45d691f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+4
-4
4 additions, 4 deletions
README.md
bootstrap-conda.sh
+78
-22
78 additions, 22 deletions
bootstrap-conda.sh
install-conda.sh
+36
-0
36 additions, 0 deletions
install-conda.sh
with
118 additions
and
26 deletions
README.md
+
4
−
4
View file @
0b687ae2
...
...
@@ -6,11 +6,11 @@ system. Use it and update it if you must.
## Basic conda installation
If you still don't have a basic conda installation, use
`
bootstrap
-conda.sh`
to
bootstrap
a new installation:
If you still don't have a basic conda installation, use
`
install
-conda.sh`
to
create
a new installation:
```
sh
$
./
bootstrap
-conda.sh /opt/conda
$
./
install
-conda.sh /opt/conda
```
The single parameter defines the prefix of the installation. You'll use this
...
...
@@ -38,7 +38,7 @@ The parameters are:
Once the environment is generated, you may generate the package list like this:
```
sh
$
/opt/conda/bin/conda list
-n
bob-devel-py27
-e
>
devel-py27.txt
$
/opt/conda/bin/conda list
-n
bob-devel-py27
-e
>
linux/
devel-py27.txt
```
...
...
This diff is collapsed.
Click to expand it.
bootstrap-conda.sh
+
78
−
22
View file @
0b687ae2
#!/usr/bin/env bash
#
Wed 17 Aug 2016 13:50:09
CEST
#
Mon 8 Aug 17:40:24 2016
CEST
if
[
"
${#}
"
!=
1
]
;
then
echo
"usage:
`
basename
$0
`
<prefix>"
echo
"example:
`
basename
$0
`
/opt/conda"
# Creates a build environment for the current package
# $1 == conda folder (e.g. "/opt/conda")
# $2 == python version (e.g. "2.7")
# $3 == local dir for environment (e.g. "env")
if
[
"
${#}
"
-ne
3
]
;
then
echo
"usage:
${
0
}
<conda-root> <python-version> <prefix>"
echo
"example:
${
0
}
/opt/conda 2.7 env"
exit
1
fi
BASEDIR
=
$1
CONDA
=
${
BASEDIR
}
/bin/conda
MINICONDA
=
${
HOME
}
/Downloads/miniconda.sh
CONDA_FOLDER
=
${
1
}
PYTHON_VERSION
=
${
2
}
PREFIX
=
`
pwd
`
/
${
3
}
WHEELS_SERVER
=
"www.idiap.ch"
WHEELS_REPOSITORY
=
"https://
${
WHEELS_SERVER
}
/software/bob/wheels/gitlab/"
# Determines the architecture we're using
if
[
"
$(
uname
)
"
==
"Darwin"
]
;
then
ARCH
=
"MacOSX-x86_64"
ARCH
=
"macosx"
else
ARCH
=
"linux"
fi
# Function for running command and echoing results
run_cmd
()
{
echo
"[(
`
date
+%c
`
)>>] Running
\"
${
@
}
\"
..."
${
@
}
if
[
"
$?
"
!=
"0"
]
;
then
echo
"[(
`
date
+%c
`
)!!] Command Failed
\"
${
@
}
\"
"
exit
1
else
echo
"[(
`
date
+%c
`
)<<] Finished comand
\"
${
@
}
\"
"
fi
}
# Clones the conda dev environment to use
if
[
!
-d
${
PREFIX
}
]
;
then
echo
"[++] Bootstrapping (clone) conda installation at
${
PREFIX
}
..."
pyver
=
$(
echo
${
PYTHON_VERSION
}
|
tr
-d
'.'
)
run_cmd curl
--silent
https://gitlab.idiap.ch/bob/bob.admin/raw/master/
${
ARCH
}
/devel-py
${
pyver
}
.txt
>
env.txt
run_cmd
${
CONDA_FOLDER
}
/bin/conda create
--prefix
${
PREFIX
}
--file
env.txt
--yes
run_cmd
${
CONDA_FOLDER
}
/bin/conda clean
--lock
else
echo
"[!!] Prefix directory
${
PREFIX
}
exists, not re-installing..."
fi
# Source the newly created conda environment
echo
"[>>] Running
\"
source
${
CONDA_FOLDER
}
/bin/activate
${
PREFIX
}
\"
..."
source
${
CONDA_FOLDER
}
/bin/activate
${
PREFIX
}
echo
"[<<] Environment
${
PREFIX
}
activated"
# Verify where pip is installed
use_pip
=
`
which pip
`
if
[
-z
"
${
use_pip
}
"
]
;
then
echo
"[!!] Cannot find pip, aborting..."
exit
1
else
ARCH
=
"Linux-x86_64
"
echo
"[++] Using pip:
${
use_pip
}
"
fi
if
[
!
-x
${
MINICONDA
}
]
;
then
mkdir
-pv
`
dirname
${
MINICONDA
}
`
echo
"[>>] Downloading
`
basename
${
MINICONDA
}
`
->
${
MINICONDA
}
..."
curl
--progress-bar
https://repo.continuum.io/miniconda/Miniconda3-latest-
${
ARCH
}
.sh
--output
${
MINICONDA
}
chmod
755
${
MINICONDA
}
use_python
=
`
which python
`
if
[
-z
"
${
use_python
}
"
]
;
then
echo
"[!!] Cannot find python, aborting..."
exit
1
else
echo
"[++] Using python:
${
use_python
}
"
fi
# Create root environment and add basic channels for conda
if
[
!
-x
${
CONDA
}
]
;
then
echo
"[>>] Creating root environment and setting basic options..."
bash
${
MINICONDA
}
-b
-p
${
BASEDIR
}
${
CONDA
}
config
--set
show_channel_urls True
${
CONDA
}
config
--add
channels conda-forge
# Install this package's build dependencies
if
[
-e
requirements.txt
]
;
then
run_cmd
${
use_pip
}
install
--find-links
${
WHEELS_REPOSITORY
}
--use-wheel
--no-index
--trusted-host
${
WHEELS_SERVER
}
--pre
--requirement
requirements.txt
else
echo
"[!!] No requirements.txt file found, skipping 'pip install <build-deps>'..."
fi
echo
"[>>] Updating conda in the root environment..."
${
CONDA
}
update
--yes
-n
root conda
# Install this package's test dependencies
if
[
-e
test-requirements.txt
]
;
then
run_cmd
${
use_pip
}
install
--find-links
${
WHEELS_REPOSITORY
}
--use-wheel
--no-index
--trusted-host
${
WHEELS_SERVER
}
--pre
--requirement
test-requirements.txt
else
echo
"[!!] No test-requirements.txt file found, skipping 'pip install <test-deps>'..."
fi
# Finally, bootstrap the installation from the new environment
if
[
-e
bootstrap-buildout.py
]
;
then
run_cmd
${
use_python
}
bootstrap-buildout.py
else
echo
"[!!] No bootstrap-buildout.py file found, skipping 'buildout bootstrap'..."
fi
This diff is collapsed.
Click to expand it.
install-conda.sh
0 → 100755
+
36
−
0
View file @
0b687ae2
#!/usr/bin/env bash
# Wed 17 Aug 2016 13:50:09 CEST
if
[
"
${#}
"
!=
1
]
;
then
echo
"usage:
`
basename
$0
`
<prefix>"
echo
"example:
`
basename
$0
`
/opt/conda"
exit
1
fi
BASEDIR
=
$1
CONDA
=
${
BASEDIR
}
/bin/conda
MINICONDA
=
${
HOME
}
/Downloads/miniconda.sh
if
[
"
$(
uname
)
"
==
"Darwin"
]
;
then
ARCH
=
"MacOSX-x86_64"
else
ARCH
=
"Linux-x86_64"
fi
if
[
!
-x
${
MINICONDA
}
]
;
then
mkdir
-pv
`
dirname
${
MINICONDA
}
`
echo
"[>>] Downloading
`
basename
${
MINICONDA
}
`
->
${
MINICONDA
}
..."
curl
--progress-bar
https://repo.continuum.io/miniconda/Miniconda3-latest-
${
ARCH
}
.sh
--output
${
MINICONDA
}
chmod
755
${
MINICONDA
}
fi
# Create root environment and add basic channels for conda
if
[
!
-x
${
CONDA
}
]
;
then
echo
"[>>] Creating root environment and setting basic options..."
bash
${
MINICONDA
}
-b
-p
${
BASEDIR
}
${
CONDA
}
config
--set
show_channel_urls True
${
CONDA
}
config
--add
channels conda-forge
fi
echo
"[>>] Updating conda in the root environment..."
${
CONDA
}
update
--yes
-n
root conda
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