EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vs-starter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Data Handling
vs-starter
Commits
5041428b
Commit
5041428b
authored
3 years ago
by
Bernhard Mallinger
Browse files
Options
Downloads
Patches
Plain Diff
Generate docker image versions from vs-deployment
parent
b4c28990
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Remove base and logging conf from vs-starter
Pipeline
#20621
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vs_starter/config.py
+15
-7
15 additions, 7 deletions
vs_starter/config.py
vs_starter/templates/docker-compose.instance.yml
+8
-8
8 additions, 8 deletions
vs_starter/templates/docker-compose.instance.yml
with
23 additions
and
15 deletions
vs_starter/config.py
+
15
−
7
View file @
5041428b
...
...
@@ -12,6 +12,7 @@ def render_config(
)
->
None
:
# get helm data
configmaps
=
get_helm_data
(
helm_config_path
,
file_type
=
"
configmap
"
)
deployments
=
get_helm_data
(
helm_config_path
,
file_type
=
"
deployment
"
)
env
=
get_helm_data
(
helm_config_path
,
file_type
=
"
deployment
"
,
index
=
True
)
# extract envs
...
...
@@ -19,6 +20,10 @@ def render_config(
# merge envs and params
merged_params
=
{
**
params
,
**
envs
}
merged_params
[
"
docker_image_versions
"
]
=
dict
(
yaml_open
(
d
)[
"
spec
"
][
"
template
"
][
"
spec
"
][
"
containers
"
][
0
][
"
image
"
].
split
(
"
:
"
)
for
d
in
deployments
)
# prepare the configs
mapping
=
prepare_configs
(
configmaps
)
...
...
@@ -65,8 +70,7 @@ def get_helm_data(helm_config_path: str, file_type: str, index: bool = False) ->
def
prepare_configs
(
configmaps
:
List
[
str
])
->
Dict
[
str
,
str
]:
file_config_mapping
=
{}
for
configmap
in
configmaps
:
with
open
(
configmap
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
cfg
:
config
=
yaml
.
load
(
cfg
,
Loader
=
yaml
.
SafeLoader
)
config
=
yaml_open
(
configmap
)
config
=
config
[
"
data
"
]
if
config
:
file_name
=
list
(
config
.
keys
())[
0
]
...
...
@@ -127,10 +131,14 @@ def render_templates(destination: str, params: Dict[str, str]) -> None:
def
extract_env_vars
(
env
:
str
)
->
Dict
[
str
,
str
]:
envs
=
{}
with
open
(
env
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
cfg
:
config
=
yaml
.
load
(
cfg
,
Loader
=
yaml
.
SafeLoader
)
env_vars
=
config
[
"
spec
"
][
"
template
"
][
"
spec
"
][
"
containers
"
][
0
][
"
env
"
]
for
var
in
env_vars
:
envs
[
var
[
"
name
"
]]
=
var
[
"
value
"
]
config
=
yaml_open
(
env
)
env_vars
=
config
[
"
spec
"
][
"
template
"
][
"
spec
"
][
"
containers
"
][
0
][
"
env
"
]
for
var
in
env_vars
:
envs
[
var
[
"
name
"
]]
=
var
[
"
value
"
]
return
envs
def
yaml_open
(
path
:
str
)
->
Any
:
with
open
(
path
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
f
:
return
yaml
.
safe_load
(
f
)
This diff is collapsed.
Click to expand it.
vs_starter/templates/docker-compose.instance.yml
+
8
−
8
View file @
5041428b
...
...
@@ -9,7 +9,7 @@ services:
tmpfs
:
size
:
536870912
renderer
:
image
:
registry.gitlab.eox.at/
esa/prism/vs/pvs_
core{{
release_version}}
# bumpversion
image
:
registry.gitlab.eox.at/
vs/
core
:
{{
docker_image_versions['registry.gitlab.eox.at/vs/core'] }}
environment
:
INSTALL_DIR
:
"
/var/www/pvs/ops/"
INSTANCE_DIR
:
"
/var/www/pvs/ops/pvs_instance/"
...
...
@@ -87,7 +87,7 @@ services:
networks
:
-
extnet
cache
:
image
:
registry.gitlab.eox.at/esa/
prism/vs/pvs_
cache{{
release_version}}
# bumpversion
image
:
registry.gitlab.eox.at/esa/
vs/
cache
:
{{
docker_image_versions['registry.gitlab.eox.at/vs/cache'] }}
configs
:
-
source
:
mapcache-ops
target
:
/mapcache-template.xml
...
...
@@ -169,7 +169,7 @@ services:
networks
:
-
extnet
registrar
:
image
:
registry.gitlab.eox.at/
esa/prism/vs/pvs_
core{{
release_version}}
# bumpversion
image
:
registry.gitlab.eox.at/
vs/
core
:
{{
docker_image_versions['registry.gitlab.eox.at/vs/core'] }}
environment
:
INSTALL_DIR
:
"
/var/www/pvs/ops/"
INSTANCE_DIR
:
"
/var/www/pvs/ops/pvs_instance/"
...
...
@@ -181,7 +181,7 @@ services:
placement
:
constraints
:
[
node.role == manager
]
ingestor
:
image
:
registry.gitlab.eox.at/
esa/prism/vs/pvs_
ingestor{{
release_version}}
# bumpversion
image
:
registry.gitlab.eox.at/
vs/
ingestor
:
{{
docker_image_versions['registry.gitlab.eox.at/vs/ingestor'] }}
environment
:
REDIS_PREPROCESS_MD_QUEUE_KEY
:
"
preprocess_queue"
INOTIFY_MASKS
:
"
IN_MOVED_TO"
...
...
@@ -189,7 +189,7 @@ services:
placement
:
constraints
:
[
node.role == manager
]
sftp
:
image
:
registry.gitlab.eox.at/esa/prism/vs/pvs_sftp
{{
release
_version}}
# bumpversion
image
:
registry.gitlab.eox.at/esa/prism/vs/pvs_sftp
:
release
-2.0.0
deploy
:
placement
:
constraints
:
[
node.role == manager
]
...
...
@@ -201,7 +201,7 @@ services:
target
:
/etc/ssh/ssh_host_ed25519_key
mode
:
0600
client
:
image
:
registry.gitlab.eox.at/
esa/prism/vs/pvs_
client{{
release_version}}
# bumpversion
image
:
registry.gitlab.eox.at/
vs/
client
:
{{
docker_image_versions['registry.gitlab.eox.at/vs/client'] }}
configs
:
-
source
:
client-ops
target
:
/usr/share/nginx/html/index.html
...
...
@@ -242,7 +242,7 @@ services:
networks
:
-
extnet
preprocessor
:
image
:
registry.gitlab.eox.at/
esa/prism/vs/pvs_
preprocessor{{
release_version}}
# bumpversion
image
:
registry.gitlab.eox.at/
vs/
preprocessor
:
{{
docker_image_versions['registry.gitlab.eox.at/vs/preprocessor'] }}
volumes
:
-
type
:
bind
source
:
/var/vhr
...
...
@@ -259,7 +259,7 @@ services:
-
node.labels.type == internal
{
%
- endif %
}
shibauth-{{slug}}
:
image
:
registry.gitlab.eox.at/esa/prism/vs/pvs_shibauth
{{
release
_version}}
# bumpversion
image
:
registry.gitlab.eox.at/esa/prism/vs/pvs_shibauth
:
release
-2.0.0
environment
:
APACHE_SERVERNAME
:
"
https://sso.{{slug}}.pass.copernicus.eu:443"
USER_CATEGORY_ALLOW_RENDERER
:
"
{{shibauth_renderer}}"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment