Each directory contains a non-trivial OAR examples; To facilitate their testing and development and ensure their reproducibility, we propose the use of NixOS-Compose (NXC).
| Directory | Description | Status | CI@Grid5000 |
|---|---|---|---|
| master | follows the OAR's master branch | maintained | TODO |
| xxx | (WIP) | - |
-
Install Nix official or Determinante version:
-
Clone this repository
# Chose a variant e.g. master
cd master
# Launch bash shell with NixOS-Compose
nix develop
# Build targeted image
nxc build -b docker
# Start composition (aka docker compose)
nxc start
# In other window
cd master
nix develop
# Open terminal per nodes within tmux (terminal multiplexer)
nxc connect
# To stop from
nxc stopcd master
nix develop
nxc build -b vm
nxc start
# In other window
cd master
nix develop
nxc connect
# To stop use Ctrl-C on nxc start process- Go https://www.grid5000.fr/w/Grid5000:Get_an_account
- First get some practice, begin by Getting Started page to discover Grid’5000
- Installation
pip install nixos-compose- You might need to modify your
$PATH:
export PATH=$PATH:~/.local/bin- To upgrade
pip install --upgrade nixos-compose- The following command will install a standalone and static Nix version in
~/.local/bin
nxc helper install-nixgit clone [email protected]:oar-team/oar-nixos-compose.gitWe take master case as example.
We recommend to build on dedicated node not on frontend to avoid its overloading.
# build on dedicated node not on frontend
# reserve one node
oarsub -I
# go to master directory
cd oar-nixos-compose/master
# build default image (flavour g5k-nfs-store to fast deploying)
nxc build# reserve some 4 nodes for 2 hours and retrieve $OAR_JOB_ID in one step
export $(oarsub -l nodes=4,walltime=2:0 "$(nxc helper g5k_script) 2h" | grep OAR_JOB_ID)
# deploy (use last built image)
nxc start -m ./OAR.$OAR_JOB_ID.stdout -W
# connect and spawn new tmux with pane for each node
nxc connectNote: nxc connect can be used to connect to only one node nxc connect . Also nxc connect is really useful only if a minimal set of tmux's key bindings are mastered (like Ctrl-b + Up, Down, Right, Left to change pane, see tmux manual for other key bindings.
Depends of each composition. See the README in each directory: README for concrete example.
oardel $OAR_JOB_IDNote: oarstat -u to list user's jobs.
# On builder node
cd oar-nixos-compose/master
nxc build -f g5k-image# On frontend
cd oar-nixos-compose/master
oarsub -l nodes=4,walltime=2:0 -t deploy -I
nxc start -m $OAR_NODEFILE --remote-deployment-info
nxc connectTODO: We use execo
- Faster building
- Incomplete support, bad or missing error handling, unstable (WIP)
- You need to ask an NXC team member to give you access to the builder
⚠️ For building step you should be on Grenoble site. Building from other sites has not been tested.- Install
setup-remote-nix.shon Grenoble site:
curl -L http://public.grenoble.grid5000.fr/~orichard/scripts/setup-remote-nix.sh -o $HOME/.local/bin/setup-remote-nix.sh
chmod 755 $HOME/.local/bin/setup-remote-nix.shThis script is used on a node to mount the store of nix-datamove.
# reserve one node
oarsub -I
# mount /nix/store of nix-datamove machine
setup-remote-nix.sh
# go to master directory
cd oar-nixos-compose/master
# build default image
nxc build -f g5k-image --mounted-store-url doozer@nix-datamove# On frontend
cd oar-nixos-compose/master
oarsub -l nodes=4,walltime=2:0 -t deploy -I
nxc start --http-deployment-info --image-store-ssh doozer@nix-datamove -m $OAR_NODEFILE# On frontend
cd oar-nixos-compose/mast
python execo_script.py --keep-job --image-store-ssh doozer@nix-datamove -j $OAR_JOB_IDsetup.toml: is a file present in each directory. It allows to apply some selectable parameters for image building, by example to change source for specific application (useful during development or test).
Below example with two setup g5k-dev and laptop selectable by option -s, e.g. nxc build -s g5k-dev or nxc build -s laptop
[project]
[g5k-dev.options]
nix-flags = "--impure" # required when source is not committed (here in /home/orichard/ear)
[g5k-dev.build.nur.repos.kapack.oar]
src = "/home/orichard/ear"
[laptop.options]
nix-flags = "--impure"
[laptop.build.nur.repos.kapack.oar]
src = "/home/auguste/dev/oar"The entry [g5k-dev.build.nur.repos.kapack.oar] specifies that the source file for EAR is located in /home/orichard/oar directory.
- tmux: It's recommended to use tmux on frontend to cope with connection error between Grid'5000 and the outside.
Launch a new session:
tmux
Attach to a previous session (typically after and broken network connection)
tmux a
Display help and keyboard shortcuts:
CTRL-b ?
Some command shortcuts:
CTRL-b " split vertically
CTRL-b % split horizontally (left/right)
CTRL-b left go to pane on the left
CTRL-b right go to pane on the right
CTRL-b up go to pane on the up
CTRL-b down go to pane on the down
CTRL-b x kill current pane
- Redeployment: If the number of nodes is the same or lower than the deployed ones it not needed to submit a new job, just execute a new
nxc start -m NODES_FILEcommand withNODES_FILEcontaining the appropriate number of machine.