-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from TranslatorSRI/dockerfile-improvements
This PR makes several updates and fixes to the Dockerfiles: * Fixed formatting issue in `requirements.txt`. * Added a .dockerignore that ignores some content that shouldn't be included in the Docker images. * Moved setup.sh into data-loading/ and renamed it to `setup-and-load-solr.sh` to clarify its purpose. This required changing the GitHub test, which uses this file to setup and load a Solr instance for testing, and adding it to `./data-loading/Dockerfile`. * Increased disk space in Kubernetes to account for larger synonym files. * Updated `data-loading/Makefile` to support synonym files, which no longer need to be converted into JSON files. * Deleted `csv2json.py`, which is no longer needed, as well as all references to these files. * In the Dockerfile for `nameresolution`: * Added a home directory and added the local bin to the PATH so we can install Python packages there. * The Dockerfile currently takes its code from the `master` branch of the GitHub repo. This can cause a problem for using GitHub to publish Docker versions, since the tag might not be at the same place as the `master` branch. This PR modifies the Dockerfile to use the source code in the same directory as the Dockerfile. This should fix #37.
- Loading branch information
Showing
14 changed files
with
46 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# We don't need the .git or .idea directories. | ||
/.git/ | ||
/.idea/ | ||
|
||
# Ignore the venv directory when preparing Dockerfile. | ||
/venv/ | ||
|
||
# I sometimes use data-loading/data for testing the data-loading code. | ||
/data-loading/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
# leverage the renci python base image | ||
FROM renciorg/renci-python-image:v0.0.1 | ||
|
||
#Set the branch | ||
ARG BRANCH_NAME=main | ||
FROM renciorg/renci-python-image:latest | ||
|
||
# install basic tools | ||
RUN apt-get update | ||
RUN apt update | ||
RUN apt upgrade -y | ||
|
||
# Make a home directory for the non-root user. | ||
RUN mkdir /home/nru | ||
RUN chown nru /home/nru | ||
|
||
# make a directory for the repo | ||
RUN mkdir /repo | ||
|
||
# go to the directory where we are going to upload the repo | ||
WORKDIR /repo | ||
RUN mkdir NameResolution | ||
RUN chown nru NameResolution | ||
USER nru | ||
|
||
# get the latest code | ||
RUN git clone --branch $BRANCH_NAME --single-branch https://github.com/TranslatorSRI/NameResolution.git | ||
# add the current code | ||
COPY . /repo/NameResolution | ||
|
||
# go to the repo dir | ||
WORKDIR /repo/NameResolution | ||
|
||
# install requirements | ||
ENV PATH="${PATH}:/home/nru/.local/bin" | ||
RUN pip install -r requirements.txt | ||
|
||
# expose the default port | ||
EXPOSE 2433 | ||
|
||
RUN chmod 777 -R . | ||
|
||
USER nru | ||
|
||
# start the service entry point | ||
ENTRYPOINT ["bash", "main.sh"] | ||
ENTRYPOINT ["bash", "main.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
dev | ||
# Ignore venv file is there is one. | ||
/venv/ | ||
|
||
|
||
# I sometimes use data-loading/data for testing the data-loading code. | ||
/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,5 @@ spec: | |
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 150Gi | ||
storage: 300Gi | ||
storageClassName: basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,5 @@ spec: | |
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 150Gi | ||
storage: 300Gi | ||
storageClassName: basic |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
requestsfastapihttpxuvicornpyyamljsonlines | ||
requests | ||
fastapi | ||
httpx | ||
uvicorn | ||
pyyaml | ||
jsonlines |
This file was deleted.
Oops, something went wrong.