Skip to content

Commit

Permalink
Dynamically fetch node id
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Oct 7, 2024
1 parent 2c08b66 commit 07e46b6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/docker-build-context/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG image
FROM $image

WORKDIR /opt/aerospike/smd

# Enable authentication
RUN echo -e "security {\n\tenable-quotas true\n}\n" >> /etc/aerospike/aerospike.template.conf
# security.smd was generated manually by
Expand All @@ -9,11 +11,14 @@ RUN echo -e "security {\n\tenable-quotas true\n}\n" >> /etc/aerospike/aerospike.
# 3. Copying /opt/aerospike/smd/security.smd from the container and committing it to this repo
# This file should always work
# TODO: generate this automatically, somehow
COPY security.smd /opt/aerospike/smd/
COPY security.smd .

# Enable strong consistency
RUN sed -i "s/\(namespace.*{\)/\1\n\tstrong-consistency true/" /etc/aerospike/aerospike.template.conf
RUN sed -i "s/\(namespace.*{\)/\1\n\tstrong-consistency-allow-expunge true/" /etc/aerospike/aerospike.template.conf
# TODO: dynamically get node-id from roster.smd
RUN sed -i "s/\(^service {\)/\1\n\tnode-id a1/" /etc/aerospike/aerospike.template.conf
COPY roster.smd /opt/aerospike/smd/
ENV ROSTER_FILE_NAME=roster.smd
COPY $ROSTER_FILE_NAME .
# TODO: uninstall jq
RUN sudo apt-get install -y jq
ENV NODE_ID=$(jq ".[1].value" $SMD_FOLDER/$ROSTER_FILE_NAME)
RUN sed -i "s/\(^service {\)/\1\n\tnode-id $NODE_ID/" /etc/aerospike/aerospike.template.conf

0 comments on commit 07e46b6

Please sign in to comment.