This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
generated from ortec/euro-neurips-vrp-2022-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate_submission.sh
60 lines (46 loc) · 1.57 KB
/
create_submission.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
DATE=$(date "+%Y-%m-%d-%H-%M-%S")
mkdir -p tmp/submissions
# C++ source and header files (incl. pybind11)
find hgs_vrptw \
-wholename "*/pybind11/tests/*" -prune -o -wholename "*/pybind11/build/*" -prune \
-o \( -name "*.cpp" -o -name "*.h" -o -name "CMakeLists.txt" -o -name "*.cmake" \) \
-exec zip -o -r "tmp/submissions/$DATE.zip" {} +
# Python code (utilities and various solver strategies + configs)
zip -o -r "tmp/submissions/$DATE.zip" strategies/*
zip -o -r "tmp/submissions/$DATE.zip" configs/solver.toml
zip -o -r "tmp/submissions/$DATE.zip" solver.py tools.py environment.py hgspy.py
# Required CodaLab file
cat > metadata <<- META
description: This file is required to indicate a code submission on the CodaLab platform. There is no need to change this file.
META
zip -o -r "tmp/submissions/$DATE.zip" metadata
rm metadata
# Python dependencies need to be provided as a requirements.txt, since we can
# only use pip in the competition system.
cat > requirements.txt <<- REQ
numpy == 1.22.2
matplotlib == 3.5.1
tomli == 2.0.1
REQ
zip -o -r "tmp/submissions/$DATE.zip" requirements.txt
rm requirements.txt
# Run and install scripts needed for CodaLab
cat > install.sh <<- INSTALL
#!/bin/bash
# Python dependencies
pip install -r requirements.txt
python -OO -m compileall .
# C++ code
mkdir -p release
cmake -Brelease -Shgs_vrptw -DCMAKE_BUILD_TYPE=Release
make --directory=release
INSTALL
cat > run.sh <<- RUN
#!/bin/bash
python solver.py
RUN
zip -o -r "tmp/submissions/$DATE.zip" run.sh install.sh
rm install.sh
rm run.sh
echo "Created tmp/submissions/$DATE.zip"