Artifactory
LASER now has a means to provide air gapped access to online package repositories that you can use from within your offline VRE. We are currently able to provide access to CRAN, Conda and PyPI repositories. Here you will find everything you need to know to gain access to them. These are one time configuration steps that will persist between sessions, but will need to be repeated for each VM you log in to within your VRE.
Setting up artifactory
The following 6 steps are common across the configuration of each artifactory mirror. If you change your Windows password you will need to configure each of the artifactory repos once more.
- From a web browser within your VRE navigate to http://artifactory:8082.
- Log in using your UoL credentials.
- In the left hand menu click Artifactory –> Artifacts.
- Choose a virtual mirror
- LASER_CRAN_virtual
- LASER_Conda_virtual
- LASER_PyPI_virtual
- At the top right of the screen click on ‘Set me up’.
- Enter your UoL password to hash and insert your credentials into the generated code snippet.
Now continue to follow the package repository specific instructions below:
CRAN
Select LASER_CRAN_virtual in step 4 above.
The code snippet will be generated directly below the password field in the ‘Configure’ tab.
Replace the contents of your Rprofile.site
file with the generated code snippet. Rprofile.site
can usually be found at C:/Program Files/R/R-x.x.x/etc/
The
Rprofile.site
file may require administrative permissions to change or copy.
If so, you can simply create a.Rprofile
file in your HOME directory or in your project working directory.R checks for profile files using the following preference order:
- Project working directory: Find out where your Project working directory is with the
getwd()
command.- HOME: the user’s home directory. Find out where your HOME is with the
path.expand("~")
command.- R_HOME: the directory in which R is installed. Find out where your R_HOME is with the
R.home()
command.For constistency we recommend creating a
.Rprofile
file in your HOME directory, usually located atC:/Users/<username>/Documents
.
You may need to restart your R session after creating the.Rprofile
file before it is recognised.
You can now install packages using
install.packages(<PACKAGE>)
Conda
Select LASER_Conda_virtual in step 4 above.
The code snippet will be generated directly below the password field in the ‘Configure’ tab.
Open anaconda python and run the below command to generate .condarc file.
conda config
Find the .condarc file in C:\Users\<USERNAME>\
, open in Notepad and replace contents with the code snippet generated by Artifactory.
You can now install packages using
conda install <PACKAGE>
Please note, even after setting the TRE to use Artifactory for conda it’s still not possible to clone your base environment.
PyPI
Select LASER_PyPI_virtual in step 4 above.
The code snippet will be generated in the ‘Resolve’ tab.
Replace the contents of the C:\Users\<USERNAME>\pip\pip.ini
file with the code snippet containing your hashed credentials. Replace the contents of the C:\Users\<USERNAME>\pip\pip.ini
file with the code snippet containing your hashed credentials.
- Artifactory may tell you to replace the contents of
pip.conf
, butpip.ini
is the Windows equivalent. - You may have to manually create
...\pip\pip.ini
if it doesn’t already exist.
Append the following to pip.ini:
trusted-host = artifactory
The full contents of pip.ini should look something like this (please ensure to include a trailing line break):
[global]
index-url = http://<USERNAME>:<PASSWORD>@artifactory:8081/artifactory/api/pypi/LASER_PyPT_virtual/simple
trusted-host = artifactory
You can now install packages using
pip install <PACKAGE>