Skip to content

Commit

Permalink
added umask 0007 to ~/.bashrc file
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Jul 8, 2024
1 parent de05a37 commit c5168cb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ COPY . /app
# groupadd --system - create a system account
# useradd --system - create a system account
# useradd --gid - name or ID of the primary group of the new account
# usermod --append - append the user to the supplemental GROUPS mentioned by the -G/--groups option without removing the user from other groups
# usermod --groups - new list of supplementary GROUPS
RUN groupadd --system json-stream && useradd --system --gid json-stream --uid 1000 json-stream && usermod --append --groups users json-stream
RUN useradd --system --gid users --uid 1000 json-stream

ENV TH2_CFG_DIR="/app/var/th2/config/"
ENV HOME="/home/json-stream"
Expand Down Expand Up @@ -41,6 +39,7 @@ ENV PYTHONPATH="${PYTHONPATH}:${PYTHON_LOCAL_LIB_PATH}:${PYTHON_SHARED_LIB_PATH}
ENV PIP_CONFIG_FILE="${HOME}/.pip/pip.conf"

RUN mkdir -p "${PYTHON_SHARED_LIB_PATH}"
RUN echo 'umask 0007' >> "${HOME}/.bashrc"

ENTRYPOINT ["python", "/app/server.py"]
CMD ["/var/th2/config/custom.json"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ You can put required files for you jupyter notebooks into `local-run/with-jupyte
Or you can mount own folder by changing value of `USER_DATA_DIR` environment variable in the `local-run/with-jupyter-notebook/.evn` file.<br>
Or change the `local-run/with-jupyter-notebook/compose.yml` file. Please note you should mount the same dictionary by the same path to `jupyter_notebook` and `json_stream_provider` services.

### provide permission for `local-run/with-jupyter-notebook/user_data` folder
`jupyter-notebook` and `json-stream-provider` use user from default linux `users` group.
It means that:
* `user_data` folder internal folder should have `rwx` permission for `users` group.
* files in `user_data` folder should have `rw` permission for `users` group.

Perhaps you will need sudo permission for the next commands

```shell
cd local-run/with-jupyter-notebook
chgrp -R users user_data/
chmod -R g=u user_data/
```

#### start command
```shell
cd local-run/with-jupyter-notebook
Expand All @@ -107,6 +121,7 @@ docker compose build

### 0.0.5

* added `umask 0007` to `~/.bashrc` file to provide rw file access for `users` group
* added `/file` request for loading content of single jsonl file
* removed ability to get any file from machine via `/file` REST APIs
* added sorting on requests `/files/notebooks` and `/files/results`
Expand Down
5 changes: 3 additions & 2 deletions local-run/with-jupyter-notebook/jupyter-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM jupyter/datascience-notebook:python-3.9
RUN echo "c.ServerApp.base_url = '/jupyter/'" >> /etc/jupyter/jupyter_server_config.py

ENV PYTHON_SHARED_LIB_PATH="${HOME}/python/lib"
ENV PYTHONPATH="${PYTHONPATH}:${PYTHON_SHARED_LIB_PATH}"
ENV PIP_TARGET="${PYTHON_SHARED_LIB_PATH}"

RUN mkdir -p "${PYTHON_SHARED_LIB_PATH}"
ENV PYTHONPATH="${PYTHONPATH}:${PYTHON_SHARED_LIB_PATH}"
ENV PIP_TARGET="${PYTHON_SHARED_LIB_PATH}"
RUN echo 'umask 0007' >> "${HOME}/.bashrc"
1 change: 0 additions & 1 deletion local-run/with-jupyter-notebook/user_data/.gitignore

This file was deleted.

0 comments on commit c5168cb

Please sign in to comment.