-
Notifications
You must be signed in to change notification settings - Fork 4
Setting up a Ska3 on Hydra
The basis for using and managing Ska3 is the Conda package manager. General instructions on installing Ska are found in Ska3 runtime environment for users.
The steps for creating a new Hydra Anaconda environment are as follows:
-
Fetch and run the Miniconda installer and specify an installation directory (in /data/sao may make sense, and for the rest of this doc, the example
/data/sao/jeanconn/ska3
has been used.).% wget https://repo.continuum.io/miniconda/Miniconda3-py38_4.8.3-Linux-x86_64.sh % bash Miniconda3-py38_4.8.3-Linux-x86_64.sh -b -p /data/sao/jeanconn/ska3
-
Get into that environment to install the rest of the packages (in bash)
% export PATH="/data/sao/jeanconn/ska3/bin:$PATH"
or
% eval "$('/data/sao/jeanconn/ska3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
-
Install a ska3-flight meta-package (I specify conda to keep it pinned).
% conda install --override-channels -c https://ska:${CONDA_PASSWORD}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/flight conda=4.8.3 ska3-flight
where I used the CONDA_PASSWORD environment variable which needs to be set to a valid password for the repository.
-
Optionally: Create a file /data/sao/jeanconn/ska3/condarc to specify conda package repos
channels: - https://ska:[email protected]/mta/ASPECT/ska3-conda/flight
but in this case one has to actually replace the password in the file, because last time I checked, conda does not do the replacement.
-
Use this environment:
% source /data/sao/jeanconn/ska3/bin/ska_envs.sh
The basis for using and managing Ska3 is the Conda package manager. So this needs to be installed before anything else can be done. If you already have the conda package manager installed then you can skip these steps and go to the Create Ska3 environment section.
The steps for creating a new Hydra Anaconda environment are as follows:
- Run the Miniconda installer and specify an installation directory (in /data/sao may make sense).
% bash /data/sao/jeanconn/Miniconda3-4.3.21-MacOSX-x86_64.sh
-
Hit ENTER, then agree to the license terms, and finally specify the installation directory. This will be created by the installer and needs to be a directory that doesn't currently exist. For the rest of this doc, the example
/data/sao/jeanconn/ska3
has been used. -
The conda packages have been copied over to /data/sao/jeanconn, but if you need to rsync those packages over again (or update... should make a script to do this).
rsync conda packages from HEAD to login node.
Source packages in
/proj/sot/ska/www/ASPECT_ICXC/ska3-conda/linux-64
/proj/sot/ska/www/ASPECT_ICXC/ska3-conda/noarch
/proj/sot/ska/www/ASPECT_ICXC/ska3-conda/core-pkg-repo/linux-64
/proj/sot/ska/www/ASPECT_ICXC/ska3-conda/core-pkg-repo/noarch
All copied into /data/sao/jeanconn/ska3-conda and /data/sao/jeanconn/core-pkg-repo
- Update the user ~/.condarc to include the copied conda package repos
binstar_upload: false
channels:
- file:///data/sao/jeanconn/core-pkg-repo
- file:///data/sao/jeanconn/ska3-conda
- defaults
default_channels:
- https://repo.continuum.io/pkgs/free
- https://repo.continuum.io/pkgs/r
- https://repo.continuum.io/pkgs/msys2
# show channel URLs when displaying what is going to be downloaded, and
# in conda list
show_channel_urls: true
- Get into that environment to install the rest of the packages (in bash)
% export PATH="/data/sao/jeanconn/ska3/bin:$PATH"
- Install a ska3-flight environment (I specify conda to keep it pinned).
% conda install conda=4.3.21 ska3-flight
For a Hydra installation, I've put the SKA data directory within the root environment. An option for now is really just to copy the ska data from the directory I've already setup to a new environment (just copy /data/sao/jeanconn/ska3/data wherever you need it). Here is what I did:
% mkdir /data/sao/jeanconn/ska3/data
Get into the ska environment and set SKA variable
% source /data/sao/jeanconn/ska3/bin/ska_envs.sh
Run ska_sync install process
% ska_sync --install
On Hydra, I've used a ssh config to do the two-hop ssh to my machine, fido. So ~/.ssh/config looks like this:
[jconnelly@login-30-1 ~]$ more ~/.ssh/config
Host *
ServerAliveInterval 120
Host pogo3
Hostname pogo3.cfa.harvard.edu
User jeanconn
Host fido
Hostname fido.cfa.harvard.edu
User jeanconn
ProxyCommand ssh -W %h:%p pogo3
Update /data/sao/jeanconn/ska3/ska_sync_config to use fido as the host (or whatever is the host specified via a proxy command in the config.
# Host machine to supply Ska data (could also be chimchim but kadi works
# from OCC VPN just as well).
host: fido
# Remote host user name. Default is local user name.
user: jeanconn
Run ska_sync to get the rsync command reminder:
% ska_sync
As instructed copy and paste the rsync line, after which you will need to enter your password. At this point it will sync the relevant Ska data files into your local Ska root.
As long as you don't change your config file, you can just re-run that same command to re-sync as needed.
To test that the data are really there make sure you can reproduce the following:
% ipython --matplotlib
>>> from Ska.tdb import msids
>>> msids.find('tephin')
[<MsidView msid="TEPHIN" technical_name="EPHIN SENSOR HOUSING TEMP">]
>>> from kadi import events
>>> events.normal_suns.filter('2014:001')
<NormalSun: start=2014:207:07:04:09.331 dur=65207>
>>> from Chandra.cmd_states import fetch_states
>>> fetch_states('2011:100', '2011:101', vals=['obsid'])
...
SOME WARNINGS WHICH ARE OK and will get patched up later
...
[ ('2011:100:11:53:12.378', '2011:101:00:26:01.434', 418823658.562, 418868827.618, 13255)
('2011:101:00:26:01.434', '2011:102:13:39:07.421', 418868827.618, 419002813.605, 12878)]
Josh maintains a ska3 environment to run yoshi for SOT MP. These directions were the prototype for that. The current update process Josh is using is to rsync the repos and update like:
From a machine at CfA:
rsync -a --delete /proj/sot/ska/www/ASPECT_ICXC/ska3-conda [email protected]:/data/sao/jwing/
rsync -a --delete /proj/sot/ska/www/ASPECT_ICXC/ska3-conda/core-pkg-repo [email protected]:/data/sao/jwing/
From hydra:
source /data/sao/jwing/ska3/bin/ska_envs.csh
conda update ska3-flight