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
754ef0aa
Commit
754ef0aa
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Check for conda-folder exists?
parent
26e50d95
No related branches found
No related tags found
1 merge request
!63
Conda package based CI
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitlab/functions.sh
+9
-1
9 additions, 1 deletion
gitlab/functions.sh
with
9 additions
and
1 deletion
gitlab/functions.sh
+
9
−
1
View file @
754ef0aa
...
@@ -268,12 +268,14 @@ fi
...
@@ -268,12 +268,14 @@ fi
# $1: Path to where to install miniconda. The path should not exist.
# $1: Path to where to install miniconda. The path should not exist.
install_miniconda
()
{
install_miniconda
()
{
log_info
"Installing miniconda in
${
1
}
..."
log_info
"Installing miniconda in
${
1
}
..."
# Download the latest conda installation script
# Download the latest conda installation script
if
[
"
${
OSNAME
}
"
==
"macosx"
]
;
then
if
[
"
${
OSNAME
}
"
==
"macosx"
]
;
then
object
=
https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
object
=
https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
else
else
object
=
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
object
=
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
fi
fi
# check if miniconda.sh exists
# check if miniconda.sh exists
if
[
!
-e
miniconda.sh
]
;
then
if
[
!
-e
miniconda.sh
]
;
then
log_info
"Downloading latest miniconda3 installer..."
log_info
"Downloading latest miniconda3 installer..."
...
@@ -282,21 +284,27 @@ install_miniconda() {
...
@@ -282,21 +284,27 @@ install_miniconda() {
log_info
"Re-using cached miniconda3 installer..."
log_info
"Re-using cached miniconda3 installer..."
ls
-l
miniconda.sh
ls
-l
miniconda.sh
fi
fi
# Check if cache exists and save urls.txt to create a valid cache after conda
# Check if cache exists and save urls.txt to create a valid cache after conda
# installation override
# installation override
_urls
=
"
${
1
}
/pkgs/urls.txt"
_urls
=
"
${
1
}
/pkgs/urls.txt"
if
[
-e
${
_urls
}
]
;
then
if
[
-e
${
_urls
}
]
;
then
run_cmd
cp
${
_urls
}
${
_urls
}
.cached
run_cmd
cp
${
_urls
}
${
_urls
}
.cached
fi
fi
# install miniconda
bash miniconda.sh
-b
-p
${
1
}
bash miniconda.sh
-b
-p
${
1
}
# Reset urls.txt
# Reset urls.txt
if
[
-e
${
_urls
}
.cached
]
;
then
if
[
-e
${
_urls
}
.cached
]
;
then
log_info
"Merging urls.txt files with cached values..."
log_info
"Merging urls.txt files with cached values..."
cat
${
_urls
}
${
_urls
}
.cached |
sort
|
uniq
>
${
_urls
}
cat
${
_urls
}
${
_urls
}
.cached |
sort
|
uniq
>
${
_urls
}
fi
fi
# List currently available packages on cache
# List currently available packages on cache
run_cmd
ls
-l
${
1
}
/pkgs/
run_cmd
ls
-l
${
1
}
/pkgs/
run_cmd
cat
${
1
}
/pkgs/urls.txt
run_cmd
cat
${
1
}
/pkgs/urls.txt
hash
-r
hash
-r
}
}
...
@@ -323,7 +331,7 @@ if [ -z "${CONDA_FOLDER}" ]; then
...
@@ -323,7 +331,7 @@ if [ -z "${CONDA_FOLDER}" ]; then
fi
fi
# check if a conda installation exists. Otherwise, install one:
# check if a conda installation exists. Otherwise, install one:
if
[
!
-e
$
1
]
;
then
if
[
!
-e
$
{
CONDA_FOLDER
}
]
;
then
install_miniconda
${
CONDA_FOLDER
}
install_miniconda
${
CONDA_FOLDER
}
fi
fi
...
...
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