Skip to content

Commit

Permalink
update for CISA style
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Sep 15, 2021
1 parent e1ebac2 commit 5b4b4d5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
build
builds
dist
package
*.pkl
*.xlsx

Expand All @@ -11,4 +7,4 @@ __pycache__
.mypy_cache
.pytest_cache
.python-version
*.egg-info
*.egg-info
3 changes: 3 additions & 0 deletions dist/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore

6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ RUN python3 -m pip install --no-cache-dir /usr/local/src/navv && \
RUN groupadd --gid ${DEFAULT_GID} ${PUSER} && \
useradd --uid ${DEFAULT_UID} --gid ${DEFAULT_GID} --home /home/${PUSER} ${PUSER} && \
usermod -a -G tty ${PUSER} && \
mkdir -p /home/${PUSER} /build && \
chown ${DEFAULT_UID}:${DEFAULT_GID} /home/${PUSER} /build && \
chmod 755 /home/${PUSER} /build
mkdir -p /home/${PUSER} /dist && \
chown ${DEFAULT_UID}:${DEFAULT_GID} /home/${PUSER} /dist && \
chmod 755 /home/${PUSER} /dist

# entrypoint to drop privileges to non-privileged user and run navv
ENTRYPOINT [ "/usr/local/bin/docker-uid-gid-setup.sh", "/usr/bin/python3", "-m", "navv" ]
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ Then use `navv-docker.sh` as described above.
It's possible to use the Docker image as a build environment from which the packaged NAVV Python library and its dependencies can be extracted for native installation on another system:

```shell
$ mkdir ./build
$ mkdir ./dist
$ docker run --rm --entrypoint=/bin/bash \
-u $(id -u) \
-v $(pwd)/build:/build \
-v $(pwd)/dist:/dist \
ghcr.io/idaholab/navv:latest navv-build-for-export.sh
Collecting build
Expand Down
10 changes: 5 additions & 5 deletions docker/navv-build-for-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ cp -vr /usr/local/src/navv/* "$TEMP_SRC_DIR"/
pushd "$TEMP_SRC_DIR"/ >/dev/null 2>&1
python3 -m build

# archive the build artifacts to /build and clean up the temporary diractory
cp -vr ./dist/* /build
# archive the build artifacts to /dist and clean up the temporary diractory
cp -vr ./dist/* /dist
popd >/dev/null 2>&1
rm -rf "$TEMP_SRC_DIR"

# also download the dependencies into /build
pushd /build >/dev/null 2>&1
# also download the dependencies into /dist
pushd /dist >/dev/null 2>&1
python3 -m pip download lxml netaddr openpyxl tqdm
popd >/dev/null 2>&1

ls -lh /build
ls -lh /dist

0 comments on commit 5b4b4d5

Please sign in to comment.