Skip to content
Snippets Groups Projects
Commit a4149fcf authored by Maël Madon's avatar Maël Madon
Browse files

instruction for install with nix-user-chroot

parent 93327f22
No related branches found
No related tags found
No related merge requests found
...@@ -3,15 +3,40 @@ ...@@ -3,15 +3,40 @@
This repository contains the material for the practical session of course [RM4ES](https://moodle.univ-tlse3.fr/course/view.php?id=4996) given in the Spring semester of 2024. This repository contains the material for the practical session of course [RM4ES](https://moodle.univ-tlse3.fr/course/view.php?id=4996) given in the Spring semester of 2024.
## Install ## Install
Ensure that you are in your home directory (run `cd`).
Clone this repository: Clone this repository:
``` ```
git clone git@gitlab.irit.fr:sepia-pub/mael/RM4ES-practicals.git git clone git@gitlab.irit.fr:sepia-pub/mael/RM4ES-practicals.git
cd RM4ES-practicals
``` ```
TODO: how to install Nix on lab computers Install [Nix]:
```bash
# download and install nix-user-chroot, a hack to install nix without root privilege
curl -L https://github.com/nix-community/nix-user-chroot/releases/download/1.2.2/nix-user-chroot-bin-1.2.2-x86_64-unknown-linux-musl --output nix-user-chroot
# give exec rights
chmod u+x nix-user-chroot
# download and install nix
./nix-user-chroot ~/.nix bash -c "curl -L https://nixos.org/nix/install | bash"
# enable cachix
mkdir -p ~/.config/nix && cp ~/RM4ES-practicals/util/nix.conf ~/.config/nix
# add a line to your bashrc
echo 'source ~/.nix-profile/etc/profile.d/nix.sh' >> ~/.bashrc
```
Now, each time you want to test your schedulers, you need to run, from the repository `RM4ES-practicals`:
```bash
~/nix-user-chroot ~/.nix bash
nix-shell -A expe
```
Or, as a one-liner:
```bash
~/nix-user-chroot ~/.nix bash -c "nix-shell -A expe"
```
TODO: how to install poetry on lab computers
## Status rn ## Status rn
We can start a small expe! We can start a small expe!
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
let let
jobs = rec { jobs = rec {
evalys = kapack.evalys.overrideAttrs (attr: rec { evalys = kapack.evalys.overrideAttrs (attr: rec {
name = "evalys"; name = "evalys";
version = "d4d47bd2f4d076730b05f1345b1bf9032cd28753"; version = "d4d47bd2f4d076730b05f1345b1bf9032cd28753";
...@@ -20,77 +19,15 @@ let ...@@ -20,77 +19,15 @@ let
}; };
}); });
# small shell to dev and test schedulers
dev = pkgs.mkShell rec {
packages = [
# kapack.pybatsim-core
pkgs.stdenv.cc.cc.lib
# python3Packages.poetry
python3
(pkgs.poetry.override { python3 = python3; })
# (python3.withPackages
# (ps: with ps; with python3Packages; [
# poetry-core
# ])
# )
];
shellHook = ''
cd sched
poetry install
export VIRTUAL_ENV_DISABLE_PROMPT=1
poetry shell
'';
LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib";
};
expe = pkgs.mkShell rec { expe = pkgs.mkShell rec {
buildInputs = [ buildInputs = [
kapack.batsim kapack.batsim-410
kapack.pybatsim-320
python3Packages.matplotlib python3Packages.matplotlib
evalys evalys
]; ];
QT_QPA_PLATFORM_PLUGIN_PATH = with pkgs.libsForQt5.qt5; "${qtbase.bin}/lib/qt-${qtbase.version}/plugins/platforms"; QT_QPA_PLATFORM_PLUGIN_PATH= with pkgs.libsForQt5.qt5; "${qtbase.bin}/lib/qt-${qtbase.version}/plugins/platforms";
}; };
test = pkgs.mkShell rec {
buildInputs = [
# pkgs.stdenv.cc.cc.lib
python3Packages.poetry-core
pkgs.poetry
];
# LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib";
};
# lib = pkgs.lib;
# pybatsim-example = python3Packages.buildPythonPackage rec {
# pname = "pybatsim-example";
# version = "local";
# format = "pyproject";
# src = lib.sourceByRegex ./sched [
# "^pyproject\.toml$"
# "^poetry\.lock$"
# "^.*\.py$"
# ];
# buildInputs = [
# poetry
# ];
# propagatedBuildInputs = [
# pybatsim-core
# ];
# };
# # example shell that enables to run the example scheduler (run `pybatsim rejector` in the shell)
# example-shell = pkgs.mkShell rec {
# buildInputs = [
# pybatsim-example
# ];
# };
}; };
in in
......
sandbox = true
experimental-features = nix-command flakes
cores = 4
max-jobs = auto
substituters = https://cache.nixos.org https://capack.cachix.org https://batsim.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= batsim.cachix.org-1:IQ/4c8P/yzhxQwp6t58LatLcvHz0qMolEHJQz9w9pxc= capack.cachix.org-1:38D+QFk3JXvMYJuhSaZ+3Nm/Qh+bZJdCrdu4pkIh5BU=
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment