Skip to content

Commit 71ce03e

Browse files
committed
Add core services for iop
Signed-off-by: Eric D. Helms <[email protected]>
1 parent 04570f8 commit 71ce03e

File tree

37 files changed

+1149
-0
lines changed

37 files changed

+1149
-0
lines changed

.github/workflows/test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,72 @@ jobs:
231231
uses: re-actors/alls-green@release/v1
232232
with:
233233
jobs: ${{ toJSON(needs) }}
234+
235+
iop-tests:
236+
strategy:
237+
fail-fast: false
238+
matrix:
239+
certificate_source:
240+
- default
241+
- installer
242+
runs-on: ubuntu-24.04
243+
steps:
244+
- uses: actions/checkout@v5
245+
- name: Set up Python
246+
uses: actions/setup-python@v6
247+
with:
248+
python-version: '3.12'
249+
- name: Setup libvirt for Vagrant
250+
uses: voxpupuli/setup-vagrant@v0
251+
- name: Install Ansible
252+
run: pip install --upgrade ansible-core
253+
- name: Setup environment
254+
run: ./setup-environment
255+
- name: Start VMs
256+
run: |
257+
./forge vms start
258+
- name: Configure repositories
259+
run: |
260+
./forge setup-repositories
261+
- name: Create installer certificates
262+
if: contains(matrix.certificate_source, 'installer')
263+
run: |
264+
./forge installer-certs
265+
- name: Run image pull
266+
run: |
267+
./foremanctl pull-images
268+
- name: Run deployment
269+
run: |
270+
./foremanctl deploy --enable-iop true --certificate-source=${{ matrix.certificate_source }} --foreman-initial-admin-password=changeme
271+
- name: Setup hammer
272+
run: |
273+
./foremanctl setup-hammer
274+
- name: Run tests
275+
run: |
276+
./forge test --pytest-args="--certificate-source=${{ matrix.certificate_source }}"
277+
- name: Run smoker
278+
run: |
279+
./forge smoker
280+
- name: Archive smoker report
281+
if: ${{ always() }}
282+
uses: actions/upload-artifact@v5
283+
with:
284+
name: smoker-iop-${{ matrix.certificate_source }}
285+
path: "/home/runner/smoker/report/"
286+
- name: Generate sos reports
287+
if: ${{ always() }}
288+
run: ./forge sos
289+
- name: Archive sos reports
290+
if: ${{ always() }}
291+
uses: actions/upload-artifact@v5
292+
with:
293+
name: sosreport-iop-${{ matrix.certificate_source }}
294+
path: sos/
295+
- name: Setup upterm session
296+
if: ${{ failure() }}
297+
uses: owenthereal/action-upterm@v1
298+
with:
299+
## limits ssh access and adds the ssh public key for the user which triggered the workflow
300+
limit-access-to-actor: true
301+
## If no one connects after 5 minutes, shut down server.
302+
wait-timeout-minutes: 5

docs/parameters.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ There are multiple use cases from the users perspective that dictate what parame
5252
| `--foreman-puma-workers` | Number of workers for Puma | `--foreman-foreman-service-puma-workers` |
5353
| `--pulp-worker-count` | Number of pulp workers | `--foreman-proxy-content-pulpcore-worker-count` |
5454

55+
#### IOP
56+
57+
##### Mapped
58+
59+
| Parameter | Description | foreman-installer Parameters |
60+
| ----------| ----------- | ---------------------------- |
61+
| `--enable-iop` | Enable deployment of IOP services | `--enable-iop` |
62+
5563
#### Certs
5664

5765
##### Mapped

src/playbooks/deploy/deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@
2929
- pulp
3030
- foreman
3131
- role: systemd_target
32+
- role: iop_core
33+
when: enable_iop | bool
3234
- post_install

src/playbooks/deploy/metadata.obsah.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ variables:
1111
help: Number of workers for Puma.
1212
pulp_worker_count:
1313
help: Number of Pulp workers. Defaults to 8 or the number of CPU cores, whichever is smaller.
14+
enable_iop:
15+
help: Enable deployment of IOP services.
1416

1517
include:
1618
- _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"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
iop_gateway_container_image: "quay.io/iop/gateway"
3+
iop_gateway_container_tag: "latest"

0 commit comments

Comments
 (0)