Skip to content

Commit 2fd7276

Browse files
committed
Add core services for iop
Signed-off-by: Eric D. Helms <[email protected]>
1 parent ab83fb1 commit 2fd7276

File tree

38 files changed

+1150
-1
lines changed

38 files changed

+1150
-1
lines changed

.github/workflows/test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,72 @@ jobs:
107107
limit-access-to-actor: true
108108
## If no one connects after 5 minutes, shut down server.
109109
wait-timeout-minutes: 5
110+
111+
iop-tests:
112+
strategy:
113+
fail-fast: false
114+
matrix:
115+
certificate_source:
116+
- default
117+
- installer
118+
runs-on: ubuntu-24.04
119+
steps:
120+
- uses: actions/checkout@v5
121+
- name: Set up Python
122+
uses: actions/setup-python@v6
123+
with:
124+
python-version: '3.12'
125+
- name: Setup libvirt for Vagrant
126+
uses: voxpupuli/setup-vagrant@v0
127+
- name: Install Ansible
128+
run: pip install --upgrade ansible-core
129+
- name: Setup environment
130+
run: ./setup-environment
131+
- name: Start VMs
132+
run: |
133+
./forge vms start
134+
- name: Configure repositories
135+
run: |
136+
./forge setup-repositories
137+
- name: Create installer certificates
138+
if: contains(matrix.certificate_source, 'installer')
139+
run: |
140+
./forge installer-certs
141+
- name: Run image pull
142+
run: |
143+
./foremanctl pull-images
144+
- name: Run deployment
145+
run: |
146+
./foremanctl deploy --enable-iop true --certificate-source=${{ matrix.certificate_source }} --foreman-initial-admin-password=changeme
147+
- name: Setup hammer
148+
run: |
149+
./foremanctl setup-hammer
150+
- name: Run tests
151+
run: |
152+
./forge test --pytest-args="--certificate-source=${{ matrix.certificate_source }}"
153+
- name: Run smoker
154+
run: |
155+
./forge smoker
156+
- name: Archive smoker report
157+
if: ${{ always() }}
158+
uses: actions/upload-artifact@v5
159+
with:
160+
name: smoker-iop-${{ matrix.certificate_source }}
161+
path: "/home/runner/smoker/report/"
162+
- name: Generate sos reports
163+
if: ${{ always() }}
164+
run: ./forge sos
165+
- name: Archive sos reports
166+
if: ${{ always() }}
167+
uses: actions/upload-artifact@v5
168+
with:
169+
name: sosreport-iop-${{ matrix.certificate_source }}
170+
path: sos/
171+
- name: Setup upterm session
172+
if: ${{ failure() }}
173+
uses: owenthereal/action-upterm@v1
174+
with:
175+
## limits ssh access and adds the ssh public key for the user which triggered the workflow
176+
limit-access-to-actor: true
177+
## If no one connects after 5 minutes, shut down server.
178+
wait-timeout-minutes: 5

development/ansible.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
host_key_checking = False
33
stdout_callback=debug
44
stderr_callback=debug
5-
roles_path = ./roles
5+
roles_path = ./roles:../src/roles
66
display_skipped_hosts = no

docs/parameters.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ There are multiple use cases from the users perspective that dictate what parame
5050
| `--foreman-initial-admin-username` | Initial username for the admin user | `--foreman-initial-admin-username` |
5151
| `--foreman-initial-admin-password` | Initial password for the admin user | `--foreman-initial-admin-password` |
5252

53+
#### IOP
54+
55+
##### Mapped
56+
57+
| Parameter | Description | foreman-installer Parameters |
58+
| ----------| ----------- | ---------------------------- |
59+
| `--enable-iop` | Enable deployment of IOP services | `--enable-iop` |
60+
5361
#### Certs
5462

5563
##### Mapped

src/playbooks/deploy/deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@
5353
- httpd
5454
- pulp
5555
- foreman
56+
- role: iop_core
57+
when: enable_iop | bool
5658
- post_install

src/playbooks/deploy/metadata.obsah.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ variables:
77
help: Initial username for the admin user.
88
foreman_initial_admin_password:
99
help: Initial password for the admin user.
10+
enable_iop:
11+
help: Enable deployment of IOP services.
1012

1113
include:
1214
- _certificate_source

src/roles/iop_core/tasks/main.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
- name: Deploy IOP Kafka service
3+
ansible.builtin.include_role:
4+
name: iop_kafka
5+
6+
- name: Deploy IOP Ingress service
7+
ansible.builtin.include_role:
8+
name: iop_ingress
9+
10+
- name: Deploy IOP Gateway service
11+
ansible.builtin.include_role:
12+
name: iop_gateway
13+
14+
- name: Deploy IOP Puptoo service
15+
ansible.builtin.include_role:
16+
name: iop_puptoo
17+
18+
- name: Deploy IOP Yuptoo service
19+
ansible.builtin.include_role:
20+
name: iop_yuptoo
21+
22+
- name: Deploy IOP Engine service
23+
ansible.builtin.include_role:
24+
name: iop_engine
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
iop_engine_container_image: "quay.io/iop/insights-engine"
3+
iop_engine_container_tag: "latest"
4+
5+
iop_engine_packages:
6+
- "insights.specs.default"
7+
- "insights.specs.insights_archive"
8+
- "insights_kafka_service.rules"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- name: Check if engine service exists
3+
ansible.builtin.systemd:
4+
name: iop-core-engine
5+
register: engine_service_status
6+
failed_when: false
7+
listen: restart engine
8+
9+
- name: Restart engine service if it exists
10+
ansible.builtin.systemd:
11+
name: iop-core-engine
12+
state: restarted
13+
when: engine_service_status.status is defined and engine_service_status.status.LoadState != "not-found"
14+
listen: restart engine
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
- name: Pull Engine container image
3+
containers.podman.podman_image:
4+
name: "{{ iop_engine_container_image }}:{{ iop_engine_container_tag }}"
5+
state: present
6+
7+
- name: Create Engine config secret
8+
containers.podman.podman_secret:
9+
state: present
10+
name: iop-core-engine-config-yml
11+
data: "{{ lookup('ansible.builtin.template', 'engine/config.yml.j2') }}"
12+
notify: restart engine
13+
14+
- name: Deploy Engine container
15+
containers.podman.podman_container:
16+
name: iop-core-engine
17+
image: "{{ iop_engine_container_image }}:{{ iop_engine_container_tag }}"
18+
state: quadlet
19+
network: host
20+
command: insights-core-engine /var/config.yml
21+
secrets:
22+
- 'iop-core-engine-config-yml,target=/var/config.yml,mode=0440,uid=1000,type=mount'
23+
etc_hosts:
24+
console.redhat.com: "127.0.0.1"
25+
quadlet_options:
26+
- |
27+
[Unit]
28+
Description=IOP Core Engine Container
29+
After=iop-core-kafka.service iop-core-ingress.service
30+
Wants=iop-core-kafka.service iop-core-ingress.service
31+
[Service]
32+
Restart=on-failure
33+
[Install]
34+
WantedBy=default.target
35+
36+
- name: Run daemon reload to make Quadlet create the service files
37+
ansible.builtin.systemd:
38+
daemon_reload: true
39+
40+
- name: Start Engine service
41+
ansible.builtin.systemd:
42+
name: iop-core-engine
43+
enabled: true
44+
state: started
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins:
2+
default_component_enabled: true
3+
packages:
4+
{% for package in iop_engine_packages %}
5+
- {{ package }}
6+
{% endfor %}
7+
configs: []
8+
service:
9+
extract_timeout: 10
10+
unpacked_archive_size_limit: 1800000000
11+
extract_tmp_dir:
12+
format: insights_kafka_service.formats._insights.InsightsFormat
13+
target_components: []
14+
consumer:
15+
name: "insights_kafka_service.consumer.InsightsKafkaConsumer"
16+
kwargs:
17+
services:
18+
- "advisor"
19+
group_id: "insights-core-kafka"
20+
queued.max.messages.kbytes: 10000
21+
session.timeout.ms: 30000
22+
max.poll.interval.ms: 600000
23+
bootstrap_servers:
24+
- "localhost:9092"
25+
incoming_topic: platform.inventory.events
26+
publisher:
27+
name: "insights_kafka_service.producer.InsightsKafkaProducer"
28+
kwargs:
29+
bootstrap_servers:
30+
- "localhost:9092"
31+
topic: platform.engine.results
32+
downloader:
33+
name: "insights_messaging.downloaders.httpfs.Http"

0 commit comments

Comments
 (0)