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
6691c1df
Commit
6691c1df
authored
3 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[boostrap] Disables conda reverse caching proxy on user request
parent
346172e0
No related branches found
No related tags found
1 merge request
!243
[boostrap] Disables conda reverse caching proxy on user request
Pipeline
#54151
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/devtools/bootstrap.py
+26
-12
26 additions, 12 deletions
bob/devtools/bootstrap.py
with
26 additions
and
12 deletions
bob/devtools/bootstrap.py
+
26
−
12
View file @
6691c1df
...
@@ -456,6 +456,15 @@ if __name__ == "__main__":
...
@@ -456,6 +456,15 @@ if __name__ == "__main__":
help
=
"
If a specific python version must be used,
"
help
=
"
If a specific python version must be used,
"
"
bootstraps a new environment with it [default: %(default)s]
"
,
"
bootstraps a new environment with it [default: %(default)s]
"
,
)
)
parser
.
add_argument
(
"
--no-proxy
"
,
default
=
(
"
BDT_NO_PROXY
"
in
os
.
environ
),
action
=
"
store_true
"
,
help
=
"
If specified, bootstrap will not use the reverse caching
"
"
proxy for downloading conda packages. You may also set the
"
"
environment variable BDT_NO_PROXY to any value, to disable
"
"
this feature.
"
,
)
parser
.
add_argument
(
parser
.
add_argument
(
"
--verbose
"
,
"
--verbose
"
,
"
-v
"
,
"
-v
"
,
...
@@ -480,19 +489,24 @@ if __name__ == "__main__":
...
@@ -480,19 +489,24 @@ if __name__ == "__main__":
condarc
=
os
.
path
.
join
(
args
.
conda_root
,
"
condarc
"
)
condarc
=
os
.
path
.
join
(
args
.
conda_root
,
"
condarc
"
)
logger
.
info
(
"
(create) %s
"
,
condarc
)
logger
.
info
(
"
(create) %s
"
,
condarc
)
with
open
(
condarc
,
"
wt
"
)
as
f
:
with
open
(
condarc
,
"
wt
"
)
as
f
:
# Replaces https://repo.anaconda.com and https://conda.anaconda.org by
if
args
.
no_proxy
:
# our proxies, so it is optimized for a CI build. Notice we consider
logger
.
info
(
"
Disabling reverse caching proxy for conda channels...
"
)
# this script is only executed in this context. The URL should NOT
f
.
write
(
_BASE_CONDARC
)
# work outside of Idiap's network.
else
:
f
.
write
(
logger
.
info
(
"
Enabling reverse caching proxy for conda channels...
"
)
_BASE_CONDARC
.
replace
(
# Replaces https://repo.anaconda.com and https://conda.anaconda.org
"
https://repo.anaconda.com
"
,
# by our proxies, so it is optimized for a CI build. Notice we
"
http://bobconda.lab.idiap.ch:8000
"
,
# consider this script is only executed in this context. The URL
).
replace
(
# should NOT work outside of Idiap's network.
"
https://conda.anaconda.org
"
,
f
.
write
(
"
http://bobconda.lab.idiap.ch:9000
"
,
_BASE_CONDARC
.
replace
(
"
https://repo.anaconda.com
"
,
"
http://bobconda.lab.idiap.ch:8000
"
,
).
replace
(
"
https://conda.anaconda.org
"
,
"
http://bobconda.lab.idiap.ch:9000
"
,
)
)
)
)
conda_version
=
"
4
"
conda_version
=
"
4
"
conda_build_version
=
"
3
"
conda_build_version
=
"
3
"
...
...
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