Blame docs/operations/ci/migration/migrate_to_new_cluster.md

47c289
# Action
47c289
If you are currently using apps.ci.centos.org (OCP 3.6) or have a job running in ci.centos.org, please contact us so that we can create a namespace for you in the new OCP 4.4 cluster for you to start migrating your jobs.
47c289
47c289
47c289
## If your own a namespace on apps.ci.centos.org
47c289
There shouldn't be a lot of changes for you as you should already have a familiar workflow working with Openshift, if you have configured your jobs at least once. While opening a ticket, or reaching out to us please do mention if you need ability to checkout duffy nodes (if yes, do you already have a duffy API key?).
47c289
47c289
See the following which explains how to open a ticket (Point 3)
47c289
47c289
47c289
## If your project is on ci.centos.org
47c289
As you are using central jenkins deployment that's not private to you, your project might see some changes. You will have your own jenkins deployment to run all your jobs instead of having a shared jenkins instance where you don't have admin access. With the extra privileges in jenkins, you can add plugins, credentials as you need and a bunch of other abilities.
47c289
This also means there is no direct maintenance required from CentOS CI Infra admins as openshift takes care of things dying or crashing and anything in the jobs config, you can take care of them yourself (We will help you get started and are always in reach if you notice any hiccups that is not auto healed). You can have the same workflow or use this opportunity to change your freestyle jobs to pipelines but that's totally on you.
47c289
See the following which explains how to open a ticket (Point 3)
47c289
47c289
47c289
### Open a project ticket
47c289
47c289
Create a new ticket in [pagure.io/centos-infra/issues](https://pagure.io/centos-infra/issues) with type ci-migration
47c289
template or [click here](https://pagure.io/centos-infra/new_issue?template=ci-migration).
47c289
47c289
We will have your accounts created in 48 hours (if no doubts/followup needed).
47c289
47c289
Note: This is only applicable for already existing projects in other places. New projects will have to go through a different process/evaluation and we may need more time (this is also applicable for projects requesting extra privileges than default admin level access to namespace).
47c289
47c289
47c289
## Setting up your jobs in cico-workspace jenkins
47c289
Configuring your jobs should be similar to your older configuration. You can either have your jobs written in trigger jobs -> groovy dialogue box, or source it from your repo (we recommend the later for easy management of jenkinsfile). One thing to point, in groovy, the node parameter type defines where the target job should be executed, the value must match either a label or a node name - otherwise the job will just stay in the queue.
47c289
We have a custom label called `cico-workspace` that has python-cicoclient installed in it so that you can request duffy nodes. This workspace will also have your duffy-api-key exported so that you can directly request nodes from duffy. Here is an example of jenkins file
47c289
47c289
```
47c289
node('cico-workspace') {
47c289
    stage('get cico node') {
47c289
        node = sh(script: "cico --debug node get -f value -c hostname -c comment", returnStdout: true).trim().tokenize(' ')
47c289
        env.node_hostname = "${node[0]}.ci.centos.org"
47c289
        env.node_ssid = "${node[1]}"
47c289
    }
47c289
47c289
    stage('tests-example') {
47c289
         println("Put your tests here")
47c289
         println("example running a test on ${node_hostname} ${node_ssid}")
47c289
    }
47c289
47c289
    stage('builds-example') {
47c289
        println("Put your builds here")
47c289
         println("example running a build on ${node_hostname} ${node_ssid}")
47c289
    }
47c289
47c289
    stage('return cico node') {
47c289
        sh 'cico node done ${node_ssid} > commandResult'
47c289
    }
47c289
}
47c289
```
47c289
47c289
## Configuring the Kubernetes concurrency limit (number of cloud executors)
47c289
As the *standard* (static) Jenkins executors have been replaced by cloud-based ones, the limit is now configured in a different place.
47c289
The configuration now resides under:
47c289
47c289
Manage Jenkins -> Manage Nodes and Clouds -> Configure Clouds -> Kubernetes -> Kubernetes Cloud details... -> Concurrency Limit
47c289
47c289
By default, the limit is set to 100, i.e. 100 parallel jobs at once. This default is in most scenarios way too high and can cause a quick
47c289
Duffy pool depletion (if the spawned pods use the Duffy nodes). So, to be a good netizen, it is recommended to set this number to some
47c289
sensible value (like 15 or 20, etc. - depends on your project), just to take in consideration the other users of the Duffy nodes & Kubernetes cluster.
47c289
47c289
## Configuring SMTP server for email notifications
47c289
If you used job email notifications in the old (legacy) instance, you will probably find out that these don't work out-of-the box in the OCP
47c289
instances. Fortunately, the solution is simple and consists of two steps:
47c289
47c289
1. In **Manage Jenkins** -> **Configure System** in the **Jenkins Location** section fill in a valid **System Admin e-mail address**. Usually you want to use
47c289
   something like *builder@\<your-Jenkins-instance-address\>* (which is also mentioned in the **Jenkins URL** field above). So, for example,
47c289
   the whole email address can be *builder@my-fabulous-app.apps.ocp.ci.centos.org* (the *builder* part is optional, you can use whatever you want).
47c289
47c289
2. Again, in **Manage Jenkins** -> **Configure System** in the section **E-mail Notifications** fill in the current SMTP relay for OCP instances, which
47c289
   is **smtp.ci.centos.org**. Then, to check if everything works as it should, check the **Test configuration by sending test e-mail** checkbox, fill in
47c289
   the recipient, and click on **Test configuration**. If the email arrives, you should be all set.