Skip to content

Commit 135a971

Browse files
committed
Update replication job - osmosis version
1 parent 492be37 commit 135a971

File tree

2 files changed

+28
-31
lines changed

2 files changed

+28
-31
lines changed

images/replication-job/Dockerfile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
FROM developmentseed/osmseed-osm-processor:0.1.0-n802.h0d9f574
1+
FROM andygol/osmosis:0.49.2
2+
USER root
23

3-
RUN apt-get update && \
4-
apt-get install -y \
5-
nginx \
6-
python3-pip \
7-
python3-venv \
8-
procps \
9-
curl && \
10-
rm -rf /var/lib/apt/lists/*
4+
RUN apk update && apk add --no-cache python3 py3-pip procps curl bash postgresql-client py3-crcmod
115

12-
RUN python3 -m venv /opt/venv
6+
RUN python3 -m venv /opt/venv \
7+
&& /opt/venv/bin/pip install --no-cache-dir \
8+
boto3 \
9+
awscli
1310
ENV PATH="/opt/venv/bin:$PATH"
14-
RUN pip install --no-cache-dir boto3
1511

1612
COPY ./*.sh /
1713
COPY monitoring.py /
1814

1915
WORKDIR /mnt/data
2016

17+
ENTRYPOINT ["/bin/bash","-lc"]
2118
CMD /start.sh

images/replication-job/start.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,26 @@ function get_current_state_file() {
3232
fi
3333
fi
3434

35-
### GCP
36-
if [ $CLOUDPROVIDER == "gcp" ]; then
37-
gsutil ls $GCP_STORAGE_BUCKET/$REPLICATION_FOLDER/state.txt
38-
if [[ $? -eq 0 ]]; then
39-
echo "File exist, let's get it from $CLOUDPROVIDER - $GCP_STORAGE_BUCKET"
40-
gsutil cp $GCP_STORAGE_BUCKET/$REPLICATION_FOLDER/state.txt $workingDirectory/state.txt
41-
fi
42-
fi
43-
44-
### Azure
45-
if [ $CLOUDPROVIDER == "azure" ]; then
46-
state_file_exists=$(az storage blob exists --container-name $AZURE_CONTAINER_NAME --name $REPLICATION_FOLDER/state.txt --query="exists")
47-
if [[ $state_file_exists=="true" ]]; then
48-
echo "File exist, let's get it from $CLOUDPROVIDER - $AZURE_CONTAINER_NAME"
49-
az storage blob download \
50-
--container-name $AZURE_CONTAINER_NAME \
51-
--name $REPLICATION_FOLDER/state.txt \
52-
--file $workingDirectory/state.txt --query="name"
53-
fi
54-
fi
35+
# ### GCP
36+
# if [ $CLOUDPROVIDER == "gcp" ]; then
37+
# gsutil ls $GCP_STORAGE_BUCKET/$REPLICATION_FOLDER/state.txt
38+
# if [[ $? -eq 0 ]]; then
39+
# echo "File exist, let's get it from $CLOUDPROVIDER - $GCP_STORAGE_BUCKET"
40+
# gsutil cp $GCP_STORAGE_BUCKET/$REPLICATION_FOLDER/state.txt $workingDirectory/state.txt
41+
# fi
42+
# fi
43+
44+
# ### Azure
45+
# if [ $CLOUDPROVIDER == "azure" ]; then
46+
# state_file_exists=$(az storage blob exists --container-name $AZURE_CONTAINER_NAME --name $REPLICATION_FOLDER/state.txt --query="exists")
47+
# if [[ $state_file_exists=="true" ]]; then
48+
# echo "File exist, let's get it from $CLOUDPROVIDER - $AZURE_CONTAINER_NAME"
49+
# az storage blob download \
50+
# --container-name $AZURE_CONTAINER_NAME \
51+
# --name $REPLICATION_FOLDER/state.txt \
52+
# --file $workingDirectory/state.txt --query="name"
53+
# fi
54+
# fi
5555
else
5656
echo "File $workingDirectory/state.txt exist in local storage"
5757
echo "File $workingDirectory/state.txt content:"

0 commit comments

Comments
 (0)