Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Show more breadcrumbs
bob
bob.devtools
Commits
aac36dd3
Commit
aac36dd3
authored
5 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[bootstrap] Check expected miniconda.sh hash, redownloads if necessary
parent
921ceac4
No related branches found
No related tags found
1 merge request
!97
Check expected miniconda.sh hash, redownloads if necessary
Pipeline
#32480
passed
5 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/devtools/bootstrap.py
+26
-8
26 additions, 8 deletions
bob/devtools/bootstrap.py
with
26 additions
and
8 deletions
bob/devtools/bootstrap.py
+
26
−
8
View file @
aac36dd3
...
@@ -200,18 +200,40 @@ def merge_conda_cache(cache, prefix, name):
...
@@ -200,18 +200,40 @@ def merge_conda_cache(cache, prefix, name):
os
.
rename
(
cached_conda_bld
,
dst
)
os
.
rename
(
cached_conda_bld
,
dst
)
def
get
_miniconda_sh
():
def
ensure
_miniconda_sh
():
"""
Retrieves the miniconda3 installer for the current system.
"""
"""
Retrieves the miniconda3 installer for the current system.
import
http.client
Checks the hash of the miniconda3 installer against the expected version,
if that does not match, erase existing installer and re-downloads new
installer.
"""
server
=
"
repo.continuum.io
"
# https
server
=
"
repo.continuum.io
"
# https
# WARNING: if you update this version, remember to update hahes below
path
=
"
/miniconda/Miniconda3-4.6.14-%s-x86_64.sh
"
path
=
"
/miniconda/Miniconda3-4.6.14-%s-x86_64.sh
"
if
platform
.
system
()
==
"
Darwin
"
:
if
platform
.
system
()
==
"
Darwin
"
:
md5sum
=
'
ffa5f0eead5576fb26b7e6902f5eed09
'
path
=
path
%
"
MacOSX
"
path
=
path
%
"
MacOSX
"
else
:
else
:
md5sum
=
'
718259965f234088d785cad1fbd7de03
'
path
=
path
%
"
Linux
"
path
=
path
%
"
Linux
"
if
os
.
path
.
exists
(
"
miniconda.sh
"
):
logger
.
info
(
"
(check) miniconda.sh md5sum (== %s?)
"
,
md5sum
)
import
hashlib
actual_md5
=
hashlib
.
md5
(
open
(
"
miniconda.sh
"
,
"
rb
"
).
read
()).
hexdigest
()
if
actual_md5
==
md5sum
:
logger
.
info
(
"
Re-using cached miniconda3 installer (hash matches)
"
)
return
else
:
logger
.
info
(
"
Erasing cached miniconda3 installer (%s NOT match)
"
,
actual_md5
)
os
.
unlink
(
"
miniconda.sh
"
)
# re-downloads installer
import
http.client
logger
.
info
(
"
Connecting to https://%s...
"
,
server
)
logger
.
info
(
"
Connecting to https://%s...
"
,
server
)
conn
=
http
.
client
.
HTTPSConnection
(
server
)
conn
=
http
.
client
.
HTTPSConnection
(
server
)
conn
.
request
(
"
GET
"
,
path
)
conn
.
request
(
"
GET
"
,
path
)
...
@@ -238,11 +260,7 @@ def install_miniconda(prefix, name):
...
@@ -238,11 +260,7 @@ def install_miniconda(prefix, name):
"""
"""
logger
.
info
(
"
Installing miniconda in %s...
"
,
prefix
)
logger
.
info
(
"
Installing miniconda in %s...
"
,
prefix
)
ensure_miniconda_sh
()
if
not
os
.
path
.
exists
(
"
miniconda.sh
"
):
# re-downloads installer
get_miniconda_sh
()
else
:
logger
.
info
(
"
Re-using cached miniconda3 installer
"
)
cached
=
None
cached
=
None
if
os
.
path
.
exists
(
prefix
):
# this is the previous cache, move it
if
os
.
path
.
exists
(
prefix
):
# this is the previous cache, move it
...
...
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