Skip to content

Commit dec407d

Browse files
authored
Merge pull request #11 from odtp-org/pipeline_parameter
Pipeline parameter
2 parents 2204b4f + c68c4ba commit dec407d

9 files changed

Lines changed: 93 additions & 6 deletions

File tree

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUN pip install -r /tmp/requirements.txt
7575
# ODTP Preparation
7676
##################################################
7777

78-
7978
# I'm not fully convinced of this folder organization.
8079
# Workdir folders should be defined in the startup bash
8180

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ ODTP component for running Eqasim.
1717

1818
2. Create your `.env` file with this structure. **If you do not have MONGODB and/or S3 activated omit this step, and just provide the scenario as environmental variable.**
1919

20+
Add the selected scenario `IDF`, or `CH`. Also select the eqasim pipeline you want to run `Synthesis`, or `matsim`.
21+
2022
```
2123
SCENARIO=IDF
24+
PIPELINE=Synthesis
2225
MONGODB_CLIENT=mongodb://.....
2326
S3_SERVER=https://....
2427
S3_ACCESS_KEY=Q0ISQ....
@@ -92,6 +95,18 @@ If you want to kill the session just write `exit`. Also use `tmux ls` to list al
9295
- Check log.txt and uploads stout to MongoDB
9396
- s3uploader.py
9497
- Upload output.zip & workdir.zip to S3. Create a mongodb entry.
98+
- parameters.py
99+
- Takes care of replacing the placeholder on the config templates.
100+
101+
## Changelog
102+
103+
- v.0.1.0: Version compatible with IDF & CH
104+
- Parameters. Now the parameters are taken from the enviroment variables.
105+
- Configuration templates. No needs of copying config.yml file anymore. The file will be built based on the parameters.
106+
- Logger: If MongoDB arg. provided the container will log its activity in the db.
107+
- S3 Compatibility: Output content, and snapshots can be uploaded to the S3 server.
108+
109+
- v.0.0.1: Version compatible with IDF
95110

96111
## Development.
97112

app/ch.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ git checkout 4658daa2e441dcda132622e7fcb47da1df8c47d6
1818

1919
# A2A - Prepare parameters & Config File
2020
# Read placeholders and create config file from Environment
21-
python3 /odtp/odtp-app/parameters.py /odtp/odtp-app/config_templates/config_ch.yml /odtp/odtp-workdir/scenario/config.yml
22-
#cp /odtp/odtp-volume/config.yml /odtp/odtp-workdir/scenario/config.yml
21+
if [ "$PIPELINE" == "Synthesis" ]; then
22+
echo "Running Synthesis PIPELINE"
23+
python3 /odtp/odtp-app/parameters.py /odtp/odtp-app/config_templates/config_synthesis_ch.yml /odtp/odtp-workdir/scenario/config.yml
24+
else
25+
echo "Running Matsim PIPELINE"
26+
python3 /odtp/odtp-app/parameters.py /odtp/odtp-app/config_templates/config_matsim_ch.yml /odtp/odtp-workdir/scenario/config.yml
27+
fi
2328

2429
# A2B - Prepare datafolder
2530
ln -s /odtp/odtp-volume/data /odtp/odtp-workdir/data
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# General pipeline settings
2+
working_directory: /odtp/odtp-workdir/cache
3+
flowchart_path: /odtp/odtp-workdir/output/flowchart.json
4+
dryrun: false
5+
6+
# Requested stages
7+
run:
8+
- synthesis.output
9+
- matsim.output
10+
11+
# These are configuration options that we use in the pipeline
12+
config:
13+
threads: [threads]
14+
osmosis_binary: /tmp/osmosis/bin/osmosis
15+
maven_binary: /tmp/maven/apache-maven-3.6.3/bin/mvn
16+
random_seed: [random_seed]
17+
hot_deck_matching_runners: [hot_deck_matching_runners]
18+
disable_progress_bar: false
19+
java_memory: [java_memory]
20+
input_downsampling: [input_downsampling]
21+
enable_scaling: [enable_scaling]
22+
scaling_year: [scaling_year]
23+
use_freight: [use_freight]
24+
hafas_date: [hafas_date]
25+
data_path: /odtp/odtp-workdir/data
26+
output_path: /odtp/odtp-workdir/output
27+
output_id: [output_id]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Synthetic population pipeline for Île-de-France
2+
## based on the synpp package
3+
4+
# This is the path to a directory where the pipeline can store temporary data
5+
working_directory: /odtp/odtp-workdir/cache
6+
7+
# This section defines which parts of the pipeline should be run
8+
run:
9+
- synthesis.output # To create the output population in the output_path (see below)
10+
- matsim.output # Uncomment, if you want to run the full simulation (you'll need Java for that)
11+
12+
# Here the configuraiton of the pipeline starts
13+
config:
14+
# Some general configuration
15+
processes: [processes]
16+
osmosis_binary: /tmp/osmosis/bin/osmosis
17+
maven_binary: /tmp/maven/apache-maven-3.6.3/bin/mvn
18+
19+
# Define whether to use ENTD or EGT as the household travel survey (HTS)
20+
hts: [hts]
21+
22+
# Define sampling rate and random seed for the output population
23+
sampling_rate: [sampling_rate]
24+
random_seed: [random_seed]
25+
26+
# Paths to the input data and where the output should be stored
27+
data_path: /odtp/odtp-workdir/data
28+
output_path: /odtp/odtp-workdir/output
29+
30+
# Only interesting if you run the simulation
31+
java_memory: [java_memory]
32+
33+
# Uncommented below to enable vehicle fleet generation
34+
# generate_vehicles_file: True
35+
# generate_vehicles_method: fleet_sample
36+
# vehicles_data_year: 2015
File renamed without changes.
File renamed without changes.

app/idf.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ git checkout b8968c1
1616

1717
# A2A - Prepare parameters & Config File
1818
# Read placeholders and create config file from Environment
19-
python3 /odtp/odtp-app/parameters.py /odtp/odtp-app/config_templates/config_idf.yml /odtp/odtp-workdir/scenario/config.yml
20-
#cp /odtp/odtp-volume/config.yml /odtp/odtp-workdir/scenario/config.yml
19+
if [ "$PIPELINE" == "Synthesis" ]; then
20+
echo "Running Synthesis PIPELINE"
21+
python3 /odtp/odtp-app/parameters.py /odtp/odtp-app/config_templates/config_synthesis_idf.yml /odtp/odtp-workdir/scenario/config.yml
22+
else
23+
echo "Running Matsim PIPELINE"
24+
python3 /odtp/odtp-app/parameters.py /odtp/odtp-app/config_templates/config_matsim_idf.yml /odtp/odtp-workdir/scenario/config.yml
25+
fi
2126

2227
# A2B - Prepare datafolder
2328
ln -s /odtp/odtp-volume/data /odtp/odtp-workdir/data

odtp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- name: eqasim
44
- repo: https://github.com/odtp-org/odtp-eqasim
55
- author: "Author Test"
6+
- original_author: Author of the tool
67
- description: Synthetic population for Matsim
78
- arguments:
89
- scenario: [idf, ch]
@@ -14,7 +15,6 @@
1415
- generted_vehicels_method: fleet_sample
1516
- vehicles_data_year: 2015
1617
- volume:
17-
- config.yml: /odtp/odtp-volume/config.yml
1818
- data: /odtp/odtp-volume/data
1919
- ports:
2020
- api: 7100

0 commit comments

Comments
 (0)