Commit fd64621e authored by Lasse Lensu's avatar Lasse Lensu
Browse files

Home directory location changed

parent 65a4d629
......@@ -12,8 +12,8 @@ For the ease of use, you can put all bash files in your home directory and immed
In order to initialize everything for the intended workflow, run `init_container.sh`. The initialization might take approximately 5 minutes. After that, you can use other provided scripts.
What it does:
1. It creates directory `docker` in your user's media volume. That directory will be mounted to the container and will serve as a persistent data storage and allow users to work with large datasets and save their computation results and source files. The location is `/media/$USER/docker` or `/media/students/$USER/docker` depending on the type of your account. It will automatically create `work` directory, which is intended to be the main working directory. Other subdirectories in `docker` will be populated automatically by the initialization procedure.
2. It will create a conda environment in the `/media/$USER/docker/env` (or `/media/students/$USER/docker/env`) directory and make it a default conda environment. That way, all python and conda packages installed during work sessions with the container will be preserved for the future use. Users can freely stop and run new containers without worrying that their packages will be lost, nor do they need to rebuild the whole image after adding new packages.
1. It creates directory `docker` in your user's home directory. That directory will be mounted to the container and will serve as a persistent data storage and allow users to work with large datasets and save their computation results and source files. It will automatically create `docker/work` directory, which is intended to be the main working directory. Other subdirectories in `docker` will be populated automatically by the initialization procedure.
2. It will create a conda environment in the `docker/env` directory and make it a default conda environment. That way, all python and conda packages installed during work sessions with the container will be preserved for the future use. Users can freely stop and run new containers without worrying that their packages will be lost, nor do they need to rebuild the whole image after adding new packages.
3. Both Pytorch and TensorFlow are installed in the new environment along with the Jupyter server.
## Proposed workflow for Jupyter
......@@ -26,7 +26,7 @@ Script will attempt to run it using port 8888. If it is already in use, it will
2. Go to `localhost:8888` (or other port, if you specified it or if 8888 is already in use) and start working.
3. By default, jupyter will open folder `/media/$USER/docker/work"` (or `/media/students/$USER/docker/work"`). You may also put any necessary data and source files inside this directory. For example, you can create folders `src` and `data` for the source files and data respectively. Inside the contaier you can access this data using path `/$USER/work/...`, where `$USER` is your username.
3. By default, jupyter will open folder `docker/work`. You may also put any necessary data and source files inside this directory. For example, you can create folders `src` and `data` for the source files and data respectively. Inside the container you can access this data using path `/$USER/work/...`, where `$USER` is your username.
## General information
......@@ -44,7 +44,7 @@ Help is available by calling any script with `-h | --help` flag.
`bash_container.sh` - run an interactive bash terminal inside a container.
`execute_in_container.sh` - execute a command inside a container. You have to specify the command, but keep in mind that only the commands from inside the container system are available. For example, if you want to run some python file, you can put it in `/media/$USER/docker/work` (or `/media/students/$USER/docker/work` if you are a student) directory, i.e `/media/$USER/docker/work/test.py` and run it using path `/$USER/src/test.py`. The full command will look like this: `execute_in_container.sh python /$USER/src/test.py` (or `execute_in_container.sh python /ekaterina/src/test.py` if your username is `ekaterina`).
`execute_in_container.sh` - execute a command inside a container. You have to specify the command, but keep in mind that only the commands from inside the container system are available. For example, if you want to run some python file, you can put it in `docker/work` directory, i.e `docker/work/test.py` and run it using path `/$USER/src/test.py`. The full command will look like this: `execute_in_container.sh python /$USER/src/test.py` (or `execute_in_container.sh python /ekaterina/src/test.py` if your username is `ekaterina`).
`init_container.sh` - initialize container with a conda environment on a mountable drive. Call this before calling other scripts. Call this only once.
......
#!/bin/bash
name="$USER"_work
source="/media/$USER/docker"
#source="/home/$USER/docker"
source="$HOME/docker"
it_flag=
d_flag=
run=
......@@ -27,7 +28,8 @@ usage()
}
if [ ! -d "$source" ]; then
source="/media/students/$USER/docker"
# source="/home/$USER/docker"
source="$HOME/docker"
fi
while [ "$1" != "" ]; do
......
#!/bin/bash
source="/media/$USER"
#source="/home/$USER"
source="$HOME"
if [ ! -d "$source" ]; then
source="/media/students/$USER"
# source="/home/$USER"
source="$HOME"
fi
mkdir $source/docker
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment