Jump to content

Portal:Toolforge/Admin/Components Service

From Wikitech

Documentation of components and common admin procedures for Toolforge/Components Service.

Short description

This service takes care of enabling the deployment of jobs and services within a tool. This includes managing:

  • Tool configuration: so the tool can be deployed without having to specify it's setup all the time (ex. push-to-deploy)
  • Deployments: that might trigger one or many builds, and run one or many jobs or services
  • Deploy tokens: to be able to trigger a deployment from external sources (ex. gitlab)

This need to specify the configuration of a tool, also introduced the concept of "components" of a tool, being the group of serivces and jobs that this tool has (aggregating scheduled jobs, continuous jobs, webservices and one-off jobs eventually).

System Components

  • Components client (source code): main entrypoint for users
  • Components API (source code): main entry-point for clients (users use the cli)


Alerts

Dashboards

You can find all the current dashboards here: https://grafana.wmcloud.org/d/6c60164e-651f-467c-91ed-737cf6fe4089/components-api

Administrative tasks

Starting a service

Components API

This lives in kubernetes, behind the API gateway. To start it you can try redepolying it, to do so follow Portal:Toolforge/Admin/Kubernetes#Deploy_new_version (the component is components-api).

You can monitor if it's coming up with the usual k8s commands:

dcaro@tools-bastion-13:~$ kubectl-sudo get all -n components-api
NAME                                  READY   STATUS    RESTARTS      AGE
pod/components-api-685b8cb7f8-8hxr6   2/2     Running   2 (23h ago)   23h
pod/components-api-685b8cb7f8-xn548   2/2     Running   2 (23h ago)   23h

NAME                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/components-api   ClusterIP   10.101.34.38   <none>        8443/TCP   12d

NAME                             READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/components-api   2/2     2            2           12d

NAME                                        DESIRED   CURRENT   READY   AGE
replicaset.apps/components-api-5544fb8cb7   0         0         0       23h
replicaset.apps/components-api-685b8cb7f8   2         2         2       12d

Stopping a service

Components API

Being a k8s deployment, the quickest way might be just to remove the deployment itself (will require redeploying to start again).

root@toolsbeta-test-k8s-control-4:~# kubectl get deployment -n components-api components-api -o yaml > backup.yaml  # in case you want to restore later with kubectl apply -f backup.yaml

root@toolsbeta-test-k8s-control-4:~# kubectl delete deployment -n components-api components-api

For a full removal (CAREFUL! Only if you know what you are doing) you can use helm:

root@toolsbeta-test-k8s-control-4:~# helm uninstall -n components-api components-api