Skip to content

Fix and improve for local deployment #1102

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
8 changes: 6 additions & 2 deletions doc/connecting-lab.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ runtime_token="N0tAS3creTT0k3n"
### `docker-compose` file

We are running all the pipeline services as docker containers.
You need to provide lab name to `--runtimes` argument to the [`scheduler-lava`](https://github.com/kernelci/kernelci-pipeline/blob/main/docker-compose.yaml#L80)
You need to provide lab name to `--runtimes` argument to the [`scheduler-lava`](https://github.com/kernelci/kernelci-pipeline/blob/main/docker-compose.yaml#L93)
service in the `docker-compose.yml` file to enable the lab.
For example, the following configuration adds the `lava-broonie` lab along with other labs:

Expand All @@ -84,13 +84,17 @@ scheduler-lava:
<<: *scheduler
container_name: 'kernelci-pipeline-scheduler-lava'
command:
- './pipeline/scheduler.py'
- './src/scheduler.py'
- '--yaml-config=/home/kernelci/config'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- 'loop'
- '--name=scheduler_lava'
- '--runtimes'
- 'lava-collabora'
- 'lava-collabora-staging'
- 'lava-broonie'
extra_hosts:
- "host.docker.internal:host-gateway"
```

### Jobs and devices specific to the lab
Expand Down
4 changes: 1 addition & 3 deletions docker-compose-kcidb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ services:

kcidb:
container_name: 'kernelci-pipeline-kcidb'
image: 'ghcr.io/kernelci/staging-kernelci:pipeline'
image: 'kernelci/staging-kernelci:pipeline'
env_file: ['.env']
stop_signal: 'SIGINT'
networks: ['kcidb']
command:
- '/usr/bin/env'
- 'python3'
- './src/send_kcidb.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- 'run'
Expand Down
31 changes: 0 additions & 31 deletions docker-compose-lava.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions docker-compose-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Copyright (C) 2023 Collabora Limited
# Author: Guillaume Tucker <[email protected]>

version: '3'

services:

lava-callback:
Expand Down
152 changes: 81 additions & 71 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
# Author: Guillaume Tucker <[email protected]>
# Author: Jeny Sadadia <[email protected]>

version: '3'
x-config-arg: &config-arg
--yaml-config=/home/kernelci/config

x-setting-arg: &setting-arg
--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}

services:

Expand All @@ -15,55 +19,45 @@ services:
stop_signal: 'SIGINT'
command:
- './src/monitor.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'run'
volumes: &base-volumes
# - './src:/home/kernelci/pipeline'
volumes:
- './config:/home/kernelci/config'
- './logs:/home/kernelci/logs'
extra_hosts:
- "host.docker.internal:host-gateway"
restart: on-failure

result_summary:
<<: *base-service
container_name: 'kernelci-pipeline-result-summary'
image: 'kernelci/staging-kernelci:pipeline'
env_file: ['.env']
stop_signal: 'SIGINT'
entrypoint:
command:
- './src/result_summary.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'run'
- '--config=${CONFIG:-/home/kernelci/config/result-summary.yaml}'
volumes:
# - './src:/home/kernelci/pipeline'
- './config:/home/kernelci/config'
- './data/output:/home/kernelci/data/output'
- './logs:/home/kernelci/logs'
#restart: on-failure

scheduler: &scheduler
<<: *base-service
container_name: 'kernelci-pipeline-scheduler'
image: 'kernelci/staging-kernelci:pipeline'
env_file: ['.env']
stop_signal: 'SIGINT'
command:
- './src/scheduler.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'loop'
- '--runtimes=shell'
- '--name=scheduler'
volumes:
# - './src:/home/kernelci/pipeline'
- './config:/home/kernelci/config'
- './data/output:/home/kernelci/data/output'
- './data/k8s-credentials/.kube:/home/kernelci/.kube'
- './data/k8s-credentials/.config/gcloud:/home/kernelci/.config/gcloud'
- './data/k8s-credentials/.azure:/home/kernelci/.azure'
- './logs:/home/kernelci/logs'
extra_hosts:
- "host.docker.internal:host-gateway"
restart: on-failure

scheduler-docker:
<<: *scheduler
Expand All @@ -72,26 +66,25 @@ services:
#working_dir: /home/kernelci
command:
- './src/scheduler.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'loop'
- '--runtimes=docker'
- '--name=scheduler_docker'
volumes:
# - './src:/home/kernelci/pipeline'
- './config:/home/kernelci/config'
- './data/output:/home/kernelci/data/output'
- './.docker-env:/home/kernelci/.docker-env'
- '/var/run/docker.sock:/var/run/docker.sock' # Docker-in-Docker
- './logs:/home/kernelci/logs'
extra_hosts:
- "host.docker.internal:host-gateway"

scheduler-lava:
<<: *scheduler
container_name: 'kernelci-pipeline-scheduler-lava'
command:
- './src/scheduler.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'loop'
- '--name=scheduler_lava'
- '--runtimes'
Expand All @@ -104,129 +97,146 @@ services:
- 'lava-cip'
- 'lava-pengutronix'
- 'lava-kontron'
extra_hosts:
- "host.docker.internal:host-gateway"

scheduler-k8s:
<<: *scheduler
container_name: 'kernelci-pipeline-scheduler-k8s'
image: 'kernelci/staging-kernelci:pipeline'
command:
- './src/scheduler.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'loop'
- '--name=scheduler_k8s'
- '--runtimes'
- 'k8s-gke-eu-west4'
- 'k8s-all'
extra_hosts:
- "host.docker.internal:host-gateway"

tarball:
<<: *base-service
container_name: 'kernelci-pipeline-tarball'
command:
- './src/tarball.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'run'
- '--name=tarball'
volumes:
# - './src:/home/kernelci/pipeline'
- './config:/home/kernelci/config'
- './data/ssh:/home/kernelci/data/ssh'
- './data/src:/home/kernelci/data/src'
- './data/output:/home/kernelci/data/output'
- './logs:/home/kernelci/logs'
extra_hosts:
- "host.docker.internal:host-gateway"

trigger:
<<: *base-service
container_name: 'kernelci-pipeline-trigger'
command:
- './src/trigger.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'run'
- '--trees=kernelci,netdev-testing'
- '--name=trigger'
extra_hosts:
- "host.docker.internal:host-gateway"

regression_tracker:
<<: *base-service
container_name: 'kernelci-pipeline-regression_tracker'
command:
- '/usr/bin/env'
- 'python3'
- '/home/kernelci/pipeline/src/regression_tracker.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- './src/regression_tracker.py'
- *config-arg
- *setting-arg
- 'run'
extra_hosts:
- "host.docker.internal:host-gateway"

test_report:
<<: *base-service
container_name: 'kernelci-pipeline-test_report'
command:
- '/usr/bin/env'
- 'python3'
- '/home/kernelci/pipeline/src/test_report.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- './src/test_report.py'
- *config-arg
- *setting-arg
- 'loop'
extra_hosts:
- "host.docker.internal:host-gateway"

timeout:
<<: *base-service
container_name: 'kernelci-pipeline-timeout'
command:
- '/usr/bin/env'
- 'python3'
- '/home/kernelci/pipeline/src/timeout.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- './src/timeout.py'
- *config-arg
- *setting-arg
- 'run'
- '--mode=timeout'
extra_hosts:
- "host.docker.internal:host-gateway"

timeout-closing:
<<: *base-service
container_name: 'kernelci-pipeline-closing'
command:
- '/usr/bin/env'
- 'python3'
- '/home/kernelci/pipeline/src/timeout.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- './src/timeout.py'
- *config-arg
- *setting-arg
- 'run'
- '--mode=closing'
extra_hosts:
- "host.docker.internal:host-gateway"

timeout-holdoff:
<<: *base-service
container_name: 'kernelci-pipeline-holdoff'
command:
- '/usr/bin/env'
- 'python3'
- '/home/kernelci/pipeline/src/timeout.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- './src/timeout.py'
- *config-arg
- *setting-arg
- 'run'
- '--mode=holdoff'
extra_hosts:
- "host.docker.internal:host-gateway"

patchset:
<<: *base-service
container_name: 'kernelci-pipeline-patchset'
command:
- './src/patchset.py'
- '--settings=${KCI_SETTINGS:-/home/kernelci/config/kernelci.toml}'
- *config-arg
- *setting-arg
- 'run'
- '--name=patchset'
volumes:
# - './src:/home/kernelci/pipeline'
- './config:/home/kernelci/config'
- './data/ssh:/home/kernelci/data/ssh'
- './data/src:/home/kernelci/data/src'
- './data/output:/home/kernelci/data/output'
- './logs:/home/kernelci/logs'

lava-callback:
<<: *base-service
container_name: 'kernelci-pipeline-lava-callback'
image: 'kernelci/staging-kernelci:lava-callback'
ports:
- '${LAVA_CALLBACK_PORT:-8100}:8000'
# With Werkzeug development server, not suitable for a public instance
command:
- './src/lava_callback.py'
- *config-arg
- *setting-arg
volumes:
- './config:/home/kernelci/config'
- './data/ssh:/home/kernelci/data/ssh'

kcidb:
<<: *base-service
container_name: 'kernelci-pipeline-kcidb'
command:
- './src/send_kcidb.py'
- *config-arg
- *setting-arg
- 'run'
- '--name=pipeline_kcidb'
volumes:
- './config:/home/kernelci/config'
- './data/kcidb:/home/kernelci/data/kcidb'
- './logs:/home/kernelci/logs'

postgres:
container_name: 'kernelci-pipeline-postgres-proxy'
image: 'gcr.io/cloud-sql-connectors/cloud-sql-proxy:latest'
command:
- 'kernelci-production:us-central1:postgresql2'
- '-c/home/kernelci/data/kcidb/kernelci-production-ci-kernelci.json'
- '-a0.0.0.0'
volumes:
- './data/kcidb:/home/kernelci/data/kcidb'
13 changes: 0 additions & 13 deletions docker/kcidb/Dockerfile

This file was deleted.

Loading