Skip to content

Commit ce425e2

Browse files
committed
Fixed readme after rebase
1 parent 93d7304 commit ce425e2

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

README.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,6 @@ Finally, double-check that the libraries have been installed.
4242

4343
mamba list
4444

45-
### Advanced
46-
47-
This is for those who want full reproducibility of the virtual environment.
48-
Create a virtual environment with just Python and conda-lock installed first.
49-
50-
mamba create --name claymodel python=3.11 conda-lock=2.5.1
51-
mamba activate claymodel
52-
53-
Generate a unified [`conda-lock.yml`](https://github.com/conda/conda-lock) file
54-
based on the dependency specification in `environment.yml`. Use only when
55-
creating a new `conda-lock.yml` file or refreshing an existing one.
56-
57-
conda-lock lock --mamba --file environment.yml --with-cuda=12.0
58-
59-
Installing/Updating a virtual environment from a lockile. Use this to sync your
60-
dependencies to the exact versions in the `conda-lock.yml` file.
61-
62-
conda-lock install --mamba --name claymodel conda-lock.yml
63-
64-
See also https://conda.github.io/conda-lock/output/#unified-lockfile for more
65-
usage details.
6645

6746
## Usage
6847

@@ -101,25 +80,46 @@ More options can be found using `python trainer.py fit --help`, or at the
10180
Our Documentation uses [Jupyter Book](https://jupyterbook.org/intro.html).
10281

10382
Install it with:
104-
In order to avoid installing dependencies directly onto the machine, a Dockerized version of the Clay model has been provided. To run it using [docker compose](https://docs.docker.com/compose/) run the following command from the repo root:
10583
```bash
10684
pip install -U jupyter-book
10785
```
10886

10987
Then build it with:
110-
Alternatively, you can build and run the Docker image using docker directly with:
11188
```bash
11289
jupyter-book build docs/
11390
```
11491

11592
You can preview the site locally with:
116-
In both cases, the default command will be run, which instantiates a [jupyter-lab](https://jupyterlab.readthedocs.io/en/stable/getting_started/starting.html) instance, from which the documentation notebooks can be run. The jupyter notebook will be accssible on the exposed port (`8888`).
117-
### Note: accessing the jupyter-lab instance in the browser requires an authentication token that can be found in the container logs. Look for the following lines:
11893
```bash
11994
python -m http.server --directory _build/html
12095
```
12196

12297
There is a GitHub Action on `./github/workflows/deploy-docs.yml` that builds the site and pushes it to GitHub Pages.
98+
99+
## Docker
100+
101+
In order to avoid installing dependencies directly onto the machine, a Dockerized version of the Clay model has been provided. To run it using [docker compose](https://docs.docker.com/compose/) run the following command from the repo root:
102+
```bash
103+
docker-compose up # using the --build flag to force a rebuild, if necessary
104+
```
105+
106+
Alternatively, you can build and run the Docker image using docker directly with:
107+
```bash
108+
docker build . -t claymodel --platform linux/amd64 # build image
109+
docker run --rm -it -v $(pwd):/model -p 8888:8888 -e ENV_NAME=claymodel --platform linux/amd64 claymodel:latest # run container
110+
```
111+
112+
In both cases, the default command will be run, which instantiates a [jupyter-lab](https://jupyterlab.readthedocs.io/en/stable/getting_started/starting.html) instance, from which the documentation notebooks can be run. The jupyter notebook will be accssible on the exposed port (`8888`).
113+
### Note: accessing the jupyter-lab instance in the browser requires an authentication token that can be found in the container logs. Look for the following lines:
114+
```bash
115+
model-claymodel-1 |
116+
model-claymodel-1 | To access the server, open this file in a browser:
117+
model-claymodel-1 | file:///home/mambauser/.local/share/jupyter/runtime/jpserver-1-open.html
118+
model-claymodel-1 | Or copy and paste one of these URLs:
119+
model-claymodel-1 | http://3a2045c995b0:8888/lab?token=587bc427e6a84b14bae0f4783567e792cfb3b95e6131f569
120+
model-claymodel-1 | http://127.0.0.1:8888/lab?token=587bc427e6a84b14bae0f4783567e792cfb3b95e6131f569
121+
```
122+
123123
Additionally the project root will be mounted as volume to the running container so any modifications made to the code base locally will be immediately reflected within the docker container.
124124

125125
### Custom commands:
@@ -133,8 +133,6 @@ or using docker directly:
133133
docker run --rm -it -v $(pwd):/model -p 8888:8888 -e ENV_NAME=claymodel --platform linux/amd64 claymodel:latest {custom command}
134134
```
135135

136-
For example, the `bash` command can be used to access an interactive bash session within the running docker container, with the `micromamba` environment already activated:
137-
(with docker-compose)
138136
For example, the `bash` command can be used to access an interactive bash session within the running docker container, with the `micromamba` environment already activated:
139137
```bash
140138
# with docker-compose

0 commit comments

Comments
 (0)