Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Add buildagent and core profile for LocalCI configuration #67

Merged
merged 8 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion roles/artemis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ artemis_database_password: #FIXME

artemis_internal_admin_password: #FIXME

proxy_ssl_certificate_path: #FIXME
proxy_ssl_certificate_path: #FIXME
proxy_ssl_certificate_key_path: #FIXME

artemis_jhipster_jwt: #FIXME
Expand Down Expand Up @@ -109,6 +109,23 @@ Jenkins configuration:
```
---

LocalCI configuration:
```
localci:
is_core_node: true
is_build_agent: true
concurrent_build_size: 2
thread_pool_size: 2
proxy:
http_proxy: "http://proxy:8080"
https_proxy: "http://proxy:8080"
no_proxy: "localhost"
image_cleanup:
expiry_days: 3
schedule_time: "0 0 4 * * *"
```
---


Athena configuration:
```
Expand Down
19 changes: 18 additions & 1 deletion roles/artemis/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ artemis_external_password_reset_link_de: "https://campus.tum.de/tumonline/ee/ui/
# artemis_auth_token_key:
# artemis_auth_token_value:
#
# localci:
# is_core_node: true
# is_build_agent: true
# concurrent_build_size: 2
# thread_pool_size: 2
# proxy:
# http_proxy: "http://proxy:8080"
# https_proxy: "http://proxy:8080"
# no_proxy: "localhost"
# image_cleanup:
# expiry_days: 3
# schedule_time: "0 0 4 * * *"
#
#athena:
# url:
# secret:
Expand Down Expand Up @@ -212,4 +225,8 @@ artemis_spring_profile_scheduling: "{% if node_id is defined and node_id == 1 %}
artemis_spring_profile_docker: "{% if use_docker %},docker{% endif %}"
artemis_spring_profile_iris: "{% if iris is defined and iris is not none %},iris{% endif %}"
artemis_spring_profile_lti: "{% if lti.oauth_secret is defined and lti.oauth_secret is not none %},lti{% endif %}"
artemis_spring_profiles: "{{ artemis_spring_profile_env }}{{ artemis_spring_profile_user_management }}{{ artemis_spring_profile_ldap }}{{ artemis_spring_profile_version_control }}{{ artemis_spring_profile_continuous_integration }}{{ artemis_spring_profile_athena }}{{ artemis_spring_profile_scheduling }}{{ artemis_spring_profile_docker }}{{ artemis_spring_profile_iris }}{{ artemis_spring_profile_lti }}"

artemis_spring_profile_core: "{% if not (continuous_integration.localci is defined and continuous_integration.localci is not none) or (continuous_integration.localci.is_core_node is defined and continuous_integration.localci.is_core_node) %},core{{ artemis_spring_profile_user_management }}{{ artemis_spring_profile_ldap }}{{ artemis_spring_profile_version_control }}{{ artemis_spring_profile_continuous_integration }}{{ artemis_spring_profile_athena }}{{ artemis_spring_profile_scheduling }}{{ artemis_spring_profile_docker }}{{ artemis_spring_profile_iris }}{{ artemis_spring_profile_lti }}{% endif %}"
artemis_spring_profile_buildagent: "{% if continuous_integration.localci is defined and continuous_integration.localci is not none %}{% if continuous_integration.localci.is_build_agent is defined and continuous_integration.localci.is_build_agent is not none and continuous_integration.localci.is_build_agent %},buildagent{% endif %}{% endif %}"

artemis_spring_profiles: "{{ artemis_spring_profile_env }}{{ artemis_spring_profile_core }}{{ artemis_spring_profile_buildagent }}"
16 changes: 16 additions & 0 deletions roles/artemis/tasks/variable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,19 @@
- continuous_integration.bamboo is defined
- continuous_integration.bamboo.bitbucket_link_name is undefined or continuous_integration.bamboo.bitbucket_link_name is none

##############################################################################
# Check localci Variables
##############################################################################

- name: Check if is either build_agent or core_node
fail:
msg: "localci configuration is incomplete - Make sure that each node is either build agent or core node"
when:
- continuous_integration.localci is defined
- not continuous_integration.localci.is_core_node | default(false) and not continuous_integration.localci.is_build_agent | default(false)
- name: Check that node 1 is a core_node
fail:
msg: "localci configuration is incomplete - Make sure that node 1 is a core_node"
when:
- continuous_integration.localci is defined
- node_id is defined and node_id == 1 and not continuous_integration.localci.is_core_node | default(false)
25 changes: 22 additions & 3 deletions roles/artemis/templates/application-prod.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,29 @@ artemis:
{% if continuous_integration.localci is defined %}
continuous-integration:
artemis-authentication-token-value: "demo"
specify-concurrent-builds: true
concurrent-build-size: 4
specify-concurrent-builds: {{ (continuous_integration.localci.concurrent_build_size is defined) | lower }}
{% if continuous_integration.localci.concurrent_build_size is defined %}
concurrent-build-size: {{ continuous_integration.localci.concurrent_build_size }}
{% endif %}
specify-thread-pool-size: {{ (continuous_integration.localci.thread_pool_size is defined) | lower }}
{% if continuous_integration.localci.thread_pool_size is defined %}
thread-pool-size: {{ continuous_integration.localci.thread_pool_size }}
{% endif %}
{% if continuous_integration.localci.proxy is defined %}
proxies:
use-system-proxy: true
default:
http-proxy: {{ continuous_integration.localci.proxy.http_proxy }}
https-proxy: {{ continuous_integration.localci.proxy.https_proxy }}
no-proxy: {{ continuous_integration.localci.proxy.no_proxy }}
{% endif %}
{% if continuous_integration.localci.image_cleanup is defined %}
image-cleanup:
enabled: true
expiry-days: {{ continuous_integration.localci.image_cleanup.expiry_days }}
cleanup-schedule-time: {{ continuous_integration.localci.image_cleanup.schedule_time }}
{% endif %}
bensofficial marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}


{% if lti is defined %}
lti:
Expand Down
19 changes: 19 additions & 0 deletions roles/artemis/templates/artemis.env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,25 @@ ARTEMIS_VERSIONCONTROL_PASSWORD='demo'
{% if continuous_integration.localci is defined %}
ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENVALUE='demo'
ARTEMIS_CONTINUOUSINTEGRATION_DOCKERCONNECTIONURI='unix:///var/run/docker.sock'
ARTEMIS_CONTINUOUSINTEGRATION_SPECIFYCONCURRENTBUILDS='{{ (continuous_integration.localci.concurrent_build_size is defined) | lower }}'
{% if continuous_integration.localci.concurrent_build_size is defined %}
ARTEMIS_CONTINUOUSINTEGRATION_CONCURRENTBUILDSIZE='{{ continuous_integration.localci.concurrent_build_size }}'
{% endif %}
ARTEMIS_CONTINUOUSINTEGRATION_SPECIFYTHREADPOOLSIZE='{{ (continuous_integration.localci.thread_pool_size is defined) | lower }}'
{% if continuous_integration.localci.thread_pool_size is defined %}
ARTEMIS_CONTINUOUSINTEGRATION_THREADPOOLSIZE='{{ continuous_integration.localci.thread_pool_size }}'
{% endif %}
{% if continuous_integration.localci.proxy is defined %}
ARTEMIS_CONTINUOUSINTEGRATION_PROXIES_USESYSTEMPROXY='true'
ARTEMIS_CONTINUOUSINTEGRATION_PROXIES_DEFAULT_HTTPPROXY='{{ continuous_integration.localci.proxy.http_proxy }}'
ARTEMIS_CONTINUOUSINTEGRATION_PROXIES_DEFAULT_HTTPSPROXY='{{ continuous_integration.localci.proxy.https_proxy }}'
ARTEMIS_CONTINUOUSINTEGRATION_PROXIES_DEFAULT_NOPROXY='{{ continuous_integration.localci.proxy.no_proxy }}'
{% endif %}
{% if continuous_integration.localci.image_cleanup is defined %}
ARTEMIS_CONTINUOUSINTEGRATION_IMAGECLEANUP_ENABLED='true'
ARTEMIS_CONTINUOUSINTEGRATION_IMAGECLEANUP_EXPIRYDAYS='{{ continuous_integration.localci.image_cleanup.expiry_days }}'
ARTEMIS_CONTINUOUSINTEGRATION_IMAGECLEANUP_CLEANUPSCHEDULETIME='{{ continuous_integration.localci.image_cleanup.schedule_time }}'
{% endif %}
{% endif %}
ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME='{{ artemis_account_login_info }}'
{% if lti is defined %}
Expand Down
Loading