openscanhub: add configurations for resalloc pools

Signed-off-by: Siteshwar Vashisht <svashisht@redhat.com>
This commit is contained in:
Siteshwar Vashisht 2024-03-11 14:57:06 +01:00 committed by zlopez
parent 65f06a461c
commit 58f566bd82
4 changed files with 86 additions and 0 deletions

View file

@ -97,6 +97,11 @@
template: etc-resallocserver-server-configmap.yml
objectname: etc-resallocserver-server-configmap
when: env == "staging"
- role: openshift/object
app: openscanhub
template: etc-resallocserver-pools-configmap.yml
objectname: etc-resallocserver-pools-configmap
when: env == "staging"
- role: openshift/object
app: openscanhub
file: deployment-resalloc-server.yml

View file

@ -56,6 +56,9 @@ spec:
- mountPath: /etc/resallocserver/server.yaml
name: etc-resallocserver-server-configmap
subPath: server.yaml
- mountPath: /etc/resallocserver/pools.yaml
name: etc-resallocserver-pools-configmap
subPath: pools.yaml
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
@ -65,3 +68,6 @@ spec:
- name: etc-resallocserver-server-configmap
configMap:
name: etc-resallocserver-server-config
- name: etc-resallocserver-pools-configmap
configMap:
name: etc-resallocserver-pools-config

View file

@ -0,0 +1,15 @@
{% macro load_file(filename) %}{% include filename %}{%- endmacro -%}
---
apiVersion: v1
kind: List
metadata: {}
items:
- apiVersion: v1
kind: ConfigMap
metadata:
name: etc-resallocserver-pools-config
labels:
app: openscanhub
data:
pools.yaml: |-
{{ load_file('etc-resallocserver-pools.yaml') | indent(6) }}

View file

@ -0,0 +1,60 @@
# This is the prefix for the name of the virtual machines.
{% if env == 'staging' %}
staging_openscanhub_aws_spot_x86_64:
{% else %}
openscanhub_aws_spot_x86_64:
{% endif %}
# This should be the same value for `MAX_SINGLE_USE_WORKERS` in `settings_local.py`.
{% if env == 'staging' %}
max: 4
{% else %}
max: 32
{% endif %}
{% if env == 'staging' %}
max_starting: 4
{% else %}
max_starting: 32
{% endif %}
max_prealloc: 0
# spot price should be cca 0.01
cmd_new: "/etc/resallocserver/vm-provisioning/resalloc-start-aws-spot-x86_64"
cmd_delete: resalloc-aws-delete --aws-profile default
cmd_livecheck: "/etc/resallocserver/vm-provisioning/resalloc-check-vm-ip"
livecheck_period: 30
cmd_list: resalloc-aws-list --aws-profile default
cmd_release: "/etc/resallocserver/vm-provisioning/resalloc-vm-release"
reuse_opportunity_time: 0
reuse_max_count: 0
reuse_max_time: 0
# TODO: Choose which tags we shall select?
# tags:
# - aws
# - aws_spot
# - name: openscanhub_worker
# priority: -5
# - arch_noarch
# - arch_x86_64
# - arch_x86_64_native
# - arch_i386
# - arch_i386_native
# - arch_i586
# - arch_i586_native
# - arch_i686
# - arch_i686_native
# - arch_armhfp
# - arch_armhfp_emulated
# - arch_s390x
# - arch_s390x_emulated
# - arch_s390
# - arch_s390_emulated
# - arch_ppc64le
# - arch_ppc64le_emulated
# - arch_ppc64
# - arch_ppc64_emulated
# - arch_ppc
# - arch_ppc_emulated