Skip to content

Commit 453aebf

Browse files
authored
Merge pull request #3895 from hove-io/modify_release
New docker worflow
2 parents c85c08a + 4f3633d commit 453aebf

36 files changed

+1195
-0
lines changed

.github/workflows/build_dockers.yml

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Build Navitia Dockers
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
tags:
8+
- '*'
9+
env:
10+
debian_version: debian8
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
container:
18+
image: navitia/${{env.debian_version}}_dev
19+
volumes:
20+
# Mount so we can delete files from docker and free up space (>20GB)
21+
- /usr/share/dotnet:/usr/share/dotnet
22+
- /usr/local/lib/android:/usr/local/lib/android
23+
24+
25+
steps:
26+
- name: Free up space
27+
run: |
28+
rm -rf /usr/share/dotnet/*
29+
rm -rf /usr/local/lib/android/*
30+
echo "Free space:"
31+
df -h
32+
33+
- name: Install dependencies
34+
run: |
35+
apt update && apt install -y --force-yes zip httpie dh-python
36+
37+
- name: Checkout core_team_ci_tools
38+
uses: actions/checkout@v3
39+
with:
40+
path: core_team_ci_tools
41+
repository : 'hove-io/core_team_ci_tools'
42+
43+
- name: Setup core_team_ci_tools python environment
44+
run: |
45+
pip install -r core_team_ci_tools/github_artifacts/requirements.txt --user
46+
47+
- name: Download mimirsbrunn package
48+
run: |
49+
mimirsbrunn_package="debian-package-release.zip"
50+
python core_team_ci_tools/github_artifacts/github_artifacts.py \
51+
-o hove-io \
52+
-r mimirsbrunn \
53+
-t ${{secrets.access_token_github}} \
54+
-w release.yml \
55+
-a $mimirsbrunn_package \
56+
--output-dir .
57+
unzip -qo $mimirsbrunn_package
58+
rm -f $mimirsbrunn_package
59+
60+
- name: Download cosmogony2cities package
61+
run: |
62+
cosmogony2cities_package="package-${{env.debian_version}}.zip"
63+
python core_team_ci_tools/github_artifacts/github_artifacts.py \
64+
-o hove-io \
65+
-r cosmogony2cities \
66+
-t ${{secrets.access_token_github}} \
67+
-w build_package.yml \
68+
-a $cosmogony2cities_package \
69+
--output-dir .
70+
unzip -qo $cosmogony2cities_package
71+
rm -f $cosmogony2cities_package
72+
73+
- name: Download libkeepalive
74+
run: |
75+
wget http://prdownloads.sourceforge.net/libkeepalive/libkeepalive-0.3.tar.gz
76+
77+
- name: Restore ccache
78+
uses: hendrikmuhs/[email protected]
79+
with:
80+
key: ${{env.debian_version}-package
81+
max-size: 2000M
82+
save: ${{ github.event_name == 'push' }}
83+
84+
- name: Checkout navitia
85+
uses: actions/checkout@v3
86+
with:
87+
submodules : recursive
88+
path: navitia
89+
fetch-depth: 0
90+
91+
- name: Build navitia packages
92+
working-directory: navitia
93+
# Will build navitia-*.deb packages in folder ../
94+
run: |
95+
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b
96+
97+
98+
# see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
99+
- name: Choose dev navitia tag
100+
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
101+
run: |
102+
echo "building version dev"
103+
echo "navitia_tag=dev" >> $GITHUB_ENV
104+
echo "aws_branch=dev" >> $GITHUB_ENV
105+
106+
- name: Choose release navitia tag
107+
if: startsWith(github.ref, 'refs/tags/')
108+
run: |
109+
cd navitia
110+
version=$(git describe)
111+
echo "building version $version"
112+
echo "navitia_tag=$version" >> $GITHUB_ENV
113+
echo "aws_branch=release" >> $GITHUB_ENV
114+
115+
- name: Create dockers images and push them
116+
run: |
117+
docker build -f navitia/docker/${{env.debian_version}}/Dockerfile-master -t navitia/master .
118+
119+
components='jormungandr kraken tyr-beat tyr-worker tyr-web instances-configurator mock-kraken eitri'
120+
for component in $components; do
121+
echo "********* Building $component ***************"
122+
docker build -t navitia/$component:${{env.navitia_tag}} -f navitia/docker/${{env.debian_version}}/Dockerfile-${component} .
123+
124+
# add latest tag if navitia_tag != dev
125+
if [[ "${{env.navitia_tag}}" != "dev" ]]; then
126+
docker tag navitia/$component:${{env.navitia_tag}} navitia/$component:latest
127+
fi
128+
done
129+
130+
docker login -u ${{secrets.docker_user}} -p ${{secrets.docker_password}}
131+
132+
for component in $components; do
133+
echo "********* Pushing $component ***************"
134+
docker push --all-tags navitia/$component:${{env.navitia_tag}}
135+
done
136+
137+
- name: Generate token for aws images
138+
id: app-token
139+
uses: getsentry/[email protected]
140+
with:
141+
app_id: ${{ secrets.GA_OS_WORKFLOW_TRIGGER_APP_ID }}
142+
private_key: ${{ secrets.GA_OS_WORKFLOW_TRIGGER_APP_PEM }}
143+
144+
- name: Aws Dispatch Backend
145+
uses: peter-evans/repository-dispatch@v2
146+
with:
147+
token: ${{ steps.app-token.outputs.token }}
148+
repository: hove-io/core-backend-aws-assets
149+
event-type: build-trigger
150+
client-payload: '{"branch": "${{ env.aws_branch }}", "tag": "${{ env.navitia_tag }}"}'
151+
152+
- name: Aws Dispatch Frontend
153+
uses: peter-evans/repository-dispatch@v2
154+
with:
155+
token: ${{ steps.app-token.outputs.token }}
156+
repository: hove-io/core-front-aws-assets
157+
event-type: build-trigger
158+
client-payload: '{"branch": "${{ env.aws_branch }}", "tag": "${{ env.navitia_tag }}"}'
159+
160+
- name: Run artemis on push to dev
161+
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
162+
uses: peter-evans/repository-dispatch@v2
163+
with:
164+
token: ${{ secrets.access_token_github }}
165+
repository: hove-io/artemis
166+
event-type: run_artemis_ng
167+
168+
- name: failure notification
169+
if: failure()
170+
run: |
171+
echo '{"text":":warning: Github Actions: build_dockers for ${{env.navitia_tag}} failed !"}' | http --json POST ${{secrets.SLACK_NAVITIA_CORE_TEAM_URL}}
172+
173+
- name: success notification on navitia core team
174+
if: success()
175+
run: |
176+
echo '{"text":":octopus: Github Actions: build_dockers succeeded. New navitia ${{env.navitia_tag}} image available.' | http --json POST ${{secrets.SLACK_NAVITIA_CORE_TEAM_URL}}

.github/workflows/publish_hove_images_aws.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
default: 'dev'
1717
required: true
1818

19+
1920
workflow_run:
2021
workflows: ["Build Navitia Packages For Release", "Build Navitia Packages For Dev Multi Distributions"]
2122
branches: [release, dev]

docker/apache/apache2.conf

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
###### # Ansible managed ######
2+
# Security
3+
TraceEnable On
4+
5+
ServerName %{APACHE_SERVER_NAME}
6+
7+
ServerRoot "/etc/apache2"
8+
PidFile ${APACHE_PID_FILE}
9+
Timeout 120
10+
KeepAlive Off
11+
MaxKeepAliveRequests 100
12+
KeepAliveTimeout 15
13+
LimitRequestFieldSize 8190
14+
15+
16+
User www-data
17+
Group www-data
18+
19+
AccessFileName .htaccess
20+
<FilesMatch "^\.ht">
21+
Require all denied
22+
</FilesMatch>
23+
24+
<Directory />
25+
Options FollowSymLinks
26+
AllowOverride None
27+
</Directory>
28+
29+
HostnameLookups Off
30+
ErrorLog /var/log/apache2/error.log
31+
LogLevel warn
32+
EnableSendfile On
33+
34+
#Listen 80
35+
36+
37+
Include "/etc/apache2/mods-enabled/*.load"
38+
Include "/etc/apache2/mods-enabled/*.conf"
39+
Include "/etc/apache2/ports.conf"
40+
41+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
42+
LogFormat "%h %l %u %t \"%r\" %>s %b" common
43+
LogFormat "%{Referer}i -> %U" referer
44+
LogFormat "%{User-agent}i" agent
45+
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\"" forwarded
46+
LogFormat "{\"time\":\"%{%s}t.%{usec_frac}t\", \"bytes_in\":\"%I\", \"bytes_out\":\"%O\", \"cookie\":\"%{Cookie}i\", \"server\":\"%v\", \"dest_port\":\"%p\", \"http_content_type\":\"%{Content-type}i\", \"http_method\":\"%m\", \"http_referrer\":\"%{Referer}i\", \"http_user_agent\":\"%{User-agent}i\", \"ident\":\"%l\", \"response_time_microseconds\":\"%D\", \"client\":\"%{X-Forwarded-For}i\", \"status\":\"%>s\", \"uri_path\":\"%U\", \"uri_query\":\"%q\", \"user\":\"%u\"}" splunk_json
47+
48+
IncludeOptional conf-enabled/*.conf
49+
IncludeOptional "/etc/apache2/sites-enabled/*"
50+

docker/apache/envvars

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# envvars - default environment variables for apache2ctl
2+
3+
# this won't be correct after changing uid
4+
unset HOME
5+
6+
# for supporting multiple apache2 instances
7+
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
8+
SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
9+
else
10+
SUFFIX=
11+
fi
12+
13+
# Since there is no sane way to get the parsed apache2 config in scripts, some
14+
# settings are defined via environment variables and then used in apache2ctl,
15+
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
16+
export APACHE_RUN_USER=www-data
17+
export APACHE_RUN_GROUP=www-data
18+
# temporary state file location. This might be changed to /run in Wheezy+1
19+
export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
20+
export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
21+
export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
22+
# Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
23+
export APACHE_LOG_DIR=/var/log/apache2$SUFFIX
24+
25+
## The locale used by some modules like mod_dav
26+
export LANG=C
27+
## Uncomment the following line to use the system default locale instead:
28+
#. /etc/default/locale
29+
30+
export LANG
31+
32+
## The command to get the status for 'apache2ctl status'.
33+
## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
34+
#export APACHE_LYNX='www-browser -dump'
35+
36+
## If you need a higher file descriptor limit, uncomment and adjust the
37+
## following line (default is 8192):
38+
#APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'
39+
40+
## If you would like to pass arguments to the web server, add them below
41+
## to the APACHE_ARGUMENTS environment.
42+
#export APACHE_ARGUMENTS=''
43+
44+
## Enable the debug mode for maintainer scripts.
45+
## This will produce a verbose output on package installations of web server modules and web application
46+
## installations which interact with Apache
47+
# export APACHE2_MAINTSCRIPT_DEBUG=1
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
###### # Ansible managed ######
2+
3+
<VirtualHost *:80>
4+
ServerName %{APACHE_SERVER_NAME}
5+
ServerAlias %{APACHE_SERVER_ALIAS}
6+
7+
Timeout 30
8+
SetEnv PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION cpp
9+
<Location /usr/src/app>
10+
Require all granted
11+
</Location>
12+
13+
AllowEncodedSlashes On
14+
15+
RewriteEngine on
16+
RewriteCond %{HTTP:Authorization} ^(.*)
17+
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
18+
19+
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
20+
RewriteRule . %1/%2 [L,PT]
21+
22+
AddOutputFilterByType DEFLATE application/json
23+
24+
CustomLog /var/log/apache2/access.log vhost_combined_timetaken
25+
26+
KeepAlive Off
27+
28+
ProxyRequests Off
29+
ProxyPreserveHost On
30+
SetEnv proxy-nokeepalive 1
31+
SetEnv force-proxy-request-1.0 1
32+
ProxyPass /server-status !
33+
ProxyPass / http://127.0.0.1:9090/ retry=0 timeout=30
34+
ProxyPassReverse / http://127.0.0.1:9090/
35+
36+
</VirtualHost>
37+

docker/apache/logformat.conf

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
###### # Ansible managed ######
2+
# Add:
3+
# - timetaken %D in microseconds
4+
# - 'Host' header: %{Host}i
5+
# http://httpd.apache.org/docs/2.2/en/mod/mod_log_config.html#formats
6+
LogFormat "%h %l %u %t [APACHE] \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D %{Host}i" vhost_combined_timetaken
7+
# Same as above, but log the PHPSESSID cookie value to identify different users
8+
# is they come from same ip (proxy)
9+
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D %{Host}i %{PHPSESSID}C" vhost_combined_timetaken_phpsessionid
10+
11+
# Same as above, but log the JSESSIONID cookie value to identify different users
12+
# is they come from same ip (proxy)
13+
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D %{Host}i %{JSESSIONID}C" vhost_combined_timetaken_jsessionid
14+
# Same as above, but log the cookie value
15+
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D %{Host}i \"%{Cookie}i\"" vhost_combined_timetaken_cookie
16+
17+

docker/ca-certificates/pca-hove.crt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIFUzCCAzugAwIBAgIRAPPkzEJyFXz2JGWaGHmMJ7IwDQYJKoZIhvcNAQENBQAw
3+
QzELMAkGA1UEBhMCRlIxEDAOBgNVBAoMB0hvdmUuaW8xDDAKBgNVBAsMA0RTSTEU
4+
MBIGA1UEAwwLYXdzLnByaXZhdGUwHhcNMjIwNTI0MTE0MDQ2WhcNMzcwNTI0MTI0
5+
MDQ2WjBDMQswCQYDVQQGEwJGUjEQMA4GA1UECgwHSG92ZS5pbzEMMAoGA1UECwwD
6+
RFNJMRQwEgYDVQQDDAthd3MucHJpdmF0ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
7+
ADCCAgoCggIBAMbj58sKK8wympczYkkTZof5PNaAvJH8mde17dV2bn7fLFtP/Wi4
8+
aD7qwle1r8X02rHQIxkTfNr6UnmEuTyLRtQh7nYPyChtns2lE+NcI30Mg1NXfSm8
9+
UPdpscsOKLkX3b5RcpbbhbeqdGlnOKq13rn4gdr3oIoNxilxDwmRffbEhWdSAhHQ
10+
FuiosSFlPZdq64xFlSp2R5ThhDA7a26oZfuiZYiJY33iDU22cMkkP9K+3CufPZIH
11+
3iPYPzNciKlOPBDvpfRA/3vCyR/VhegEjolozOO7xd8uW6VYJWm63bZtoYplJa4Z
12+
KVx2PAuMESPHPzaPFVXh2/i9e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jLNsx8fb/yFtsGYleDmLnQSqIztGdcDDCAjxop0W6+Cf1kdyhzthsfmizlD5N9
29+
r76uVwKp6FYQxAThEbWzphWxGPoOgVQGDX4PqhqIAy/CjX4/MLaJvvmQUN1An1te
30+
WRJz05Q3y4UkRP6LTBtG3LFsmei69gg=
31+
-----END CERTIFICATE-----

docker/debian10/Dockerfile-eitri

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM navitia/master
2+
3+
# copy package from context inside the docker
4+
COPY navitia-ed_*.deb /
5+
COPY navitia/source/ /navitia/source/
6+
7+
# install dependencies
8+
RUN apt-get update \
9+
&& apt-get install -y python3 python3-pip libpq-dev jq git zip curl \
10+
&& apt-get install -y /navitia-ed_*.deb \
11+
&& apt-get clean \
12+
&& rm -rf /navitia-ed_*.deb
13+
14+
# install eitri requirements
15+
RUN pip3 install --no-cache-dir -r /navitia/source/eitri/requirements.txt

0 commit comments

Comments
 (0)