-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-46257: Add Docker support for ppdb-replication #3
Conversation
702d3f2
to
f87628b
Compare
3620429
to
9449163
Compare
147abf0
to
b45406f
Compare
ba21a7e
to
5437383
Compare
238ef40
to
10340e9
Compare
7534446
to
b48e754
Compare
b48e754
to
9b710c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, a couple of minor comments.
docker/Dockerfile.replication
Outdated
WORKDIR /app | ||
|
||
# Install sdm_schemas | ||
RUN git clone https://github.com/lsst/sdm_schemas.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add --depth=0
option to avoid cloning full history?
Just a general comment for the future - we may need to install a specific version of sdm_schemas
that matches the version of the database schema. It may be even better to delay or avoid cloning sdm_schemas into the image, to be able to use the same image with different schema version. Something to work out later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add
--depth=0
option to avoid cloning full history?
Good idea - will do.
Just a general comment for the future - we may need to install a specific version of
sdm_schemas
that matches the version of the database schema. It may be even better to delay or avoid cloning sdm_schemas into the image, to be able to use the same image with different schema version. Something to work out later.
I improved the Dockfile so that it has an SDM_SCHEMAS_REF
variable with the branch of sdm_schemas to use. By default, it will use main
. Right now, we can't change this in the GitHub Action (it doesn't support setting environment variables for the Docker build), but the version can be updated directly in Dockerfile.replication
for development if another ref than main
should be used.
[ -n "${PPDB_REPLICATION_APDB_CONFIG:-}" ] && _CMD="$_CMD $PPDB_REPLICATION_APDB_CONFIG" | ||
[ -n "${PPDB_REPLICATION_PPDB_CONFIG:-}" ] && _CMD="$_CMD $PPDB_REPLICATION_PPDB_CONFIG" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two must be non-empty, no need to check them again?
# Check the exit status of the command | ||
status=$? | ||
if [ $status -ne 0 ]; then | ||
echo "Command failed with exit status $status" | ||
exit $status | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With set -e
if $_CMD
fails then the shell will exit immediately, this if
is only ever executed if status=0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will remove it.
ed041ae
to
5480e09
Compare
This will run the ppdb-replication command, which is installed through pip. The entrypoint script used to run the command will convert the PPDB environment variables into the appropriate command line arguments.
This only builds the Docker image for ppdb-replication. Add additional steps to build other Docker images.
5480e09
to
c0ce551
Compare
No description provided.