@@ -29,52 +29,46 @@ COPY src/classifier_multiclass.py \
2929COPY input/* /input/.
3030COPY models/model_GradientBoostingClassifier.pkl /models/.
3131
32- # Make main executable
33- RUN chmod +x /main -r
34-
35- # Expose the port the server will run on
36- EXPOSE 8080
37-
38- CMD date && \
39- echo "Download..." && \
40- remote_target_date=$(curl -sI http://131.123.42.41/target_vecs.txt | grep -i "Last-Modified" | cut -d' ' -f2-) && \
41- remote_token_date=$(curl -sI http://131.123.42.41/token_vecs.txt | grep -i "Last-Modified" | cut -d' ' -f2-) && \
42- remote_words_date=$(curl -sI http://131.123.42.41/abbreviationList.csv | grep -i "Last-Modified" | cut -d' ' -f2-) && \
43- remote_dictionary_date=$(curl -sI htp://131.123.42.41/en.txt | grep -i "Last-Modified" | cut -d' ' -f2-) && \
32+ CMD date; \
33+ echo "Download..." ; \
34+ remote_target_date=$(curl -sI http://131.123.42.41/target_vecs.txt | grep -i "Last-Modified" | cut -d' ' -f2-); \
35+ remote_token_date=$(curl -sI http://131.123.42.41/token_vecs.txt | grep -i "Last-Modified" | cut -d' ' -f2-); \
36+ remote_words_date=$(curl -sI http://131.123.42.41/abbreviationList.csv | grep -i "Last-Modified" | cut -d' ' -f2-); \
37+ remote_dictionary_date=$(curl -sI htp://131.123.42.41/en.txt | grep -i "Last-Modified" | cut -d' ' -f2-); \
4438 if [ -n "$remote_target_date" ] && [ -n "$remote_token_date" ]; then \
45- remote_target_timestamp=$(date -d "$remote_target_date" +%s) && \
46- remote_token_timestamp=$(date -d "$remote_token_date" +%s) && \
47- remote_words_timestamp=$(date -d "$remote_words_date" +%s) && \
48- remote_dictionary_timestamp=$(date -d "$remote_dictionary_date" +%s) && \
39+ remote_target_timestamp=$(date -d "$remote_target_date" +%s); \
40+ remote_token_timestamp=$(date -d "$remote_token_date" +%s); \
41+ remote_words_timestamp=$(date -d "$remote_words_date" +%s); \
42+ remote_dictionary_timestamp=$(date -d "$remote_dictionary_date" +%s); \
4943 if [ ! -f /code2vec/target_vecs.txt ] || [ $remote_target_timestamp -gt $(date -r /code2vec/target_vecs.txt +%s) ]; then \
50- curl -s -o /code2vec/target_vecs.txt http://131.123.42.41/target_vecs.txt && \
44+ curl -s -o /code2vec/target_vecs.txt http://131.123.42.41/target_vecs.txt; \
5145 echo "target_vecs.txt updated" ; \
5246 else \
5347 echo "target_vecs.txt not updated" ; \
54- fi && \
48+ fi; \
5549 if [ ! -f /code2vec/token_vecs.txt ] || [ $remote_token_timestamp -gt $(date -r /code2vec/token_vecs.txt +%s) ]; then \
56- curl -s -o /code2vec/token_vecs.txt http://131.123.42.41/token_vecs.txt && \
50+ curl -s -o /code2vec/token_vecs.txt http://131.123.42.41/token_vecs.txt; \
5751 echo "token_vecs.txt updated" ; \
5852 else \
5953 echo "token_vecs.txt not updated" ; \
60- fi && \
54+ fi; \
6155 if [ ! -r /words/abbreviationList.csv ] || [ $remote_words_timestamp -gt $(date -r /words/abbreviationList.csv +%s) ]; then \
62- curl -s -o /words/abbreviationList.csv http://131.123.42.41/abbreviationList.csv && \
56+ curl -s -o /words/abbreviationList.csv http://131.123.42.41/abbreviationList.csv; \
6357 echo "abbreviationList.csv updated" ; \
6458 else \
6559 echo "abbreviationList.csv not updated" ; \
66- fi && \
60+ fi; \
6761 if [ ! -r /words/en.txt ] || [ $remote_dictionary_timestamp -gt $(date -r /words/en.txt +%s) ]; then \
68- curl -s -o /words/en.txt http://131.123.42.41/en.txt && \
62+ curl -s -o /words/en.txt http://131.123.42.41/en.txt; \
6963 echo "en.txt updated" ; \
7064 else \
7165 echo "en.txt not updated" ; \
7266 fi; \
7367 else \
7468 echo "Failed to retrieve Last-Modified headers" ; \
75- fi && \
76- date && \
77- echo "Starting server ..." && \
69+ fi; \
70+ date; \
71+ echo "Running ..." ; \
7872 /main -r --words words/abbreviationList.csv
7973
8074ENV TZ=US/Michigan
0 commit comments