Skip to content

Commit 6099f37

Browse files
authored
ci.git revamp (zephyrproject-rtos#2)
* updating readme, adding ci.wiki from gitlab * Adding git secret protected hidden/ directory with teamforge zdevops-keys, [email protected] access only, currently. * Adding ci.git wiki files * move functional directories into /src, removed skiplist + overdue README.md update * Update README.md * hide-hidden: clarify script operation comments * Adding zabbix server install script to /src/zabbix * Adding gpg key for [email protected] to hidden/ keyring
1 parent 7bd1309 commit 6099f37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+718
-40
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.gitsecret/keys/random_seed
2+
hidden.tar
3+
hidden/

.gitsecret/keys/mapping.cfg

Whitespace-only changes.

.gitsecret/keys/pubring.kbx

3.85 KB
Binary file not shown.

.gitsecret/keys/pubring.kbx~

1.94 KB
Binary file not shown.

.gitsecret/keys/trustdb.gpg

1.17 KB
Binary file not shown.

.gitsecret/paths/mapping.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hidden.tar:

README.md

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
# Intel internal Zephyr CI
2-
## *operated by your friendly IAGS/FMOS Zephyr DevOps team*
3-
### mail PDL: FMOS_DevOps
4-
5-
## [DevOps Documentation Wiki](https://gitlab.devtools.intel.com/zephyrproject-rtos/ci/-/wikis/home)
6-
## [Zephyr DevOps Overview](https://intel-my.sharepoint.com/:p:/p/christopher_g_turner/EfZ2TF9ElydPjpGBEAKiUkwBiFt5LFBZPI2aGO_HZnP7Wg?e=Bxeeho)
7-
8-
# CI Terminology
9-
* **Jenkins** - A popular open-source CI/CD tool. Zephyr DevOps operates several Jenkins master instances at zerobot2, zerobot-stg & zephyr-ci.
10-
* **Agent** - Jenkins terminology for a remote computer used for building, testing in a CI/CD pipeline. Any computer capable of executing commands over ssh can be a Jenkins agent.
11-
* **Test-agent** - Jenkins agent that's configured for device-testing
12-
* **Build-agent** - Jenkins agent that's intended for virtual (qemu-only) sanitycheck jobs, not device-testing
13-
* **Test-head** - A dedicated server that provides services for a set of agents, via test-network.
14-
* **Test-net** - Private network linking a Testhead with a set of agents, implemented as a star-topology around a Gigabit Ethernet switch
15-
* **PXE Boot** - Also known as "network boot", this service allows a computer to receive it's operating system via a network link, removing the requirement for a hard-disk
16-
* **PXE Boot Docker (pxeboot.docker)** - Zephyr DevOps-created tool that provides PXE boot services & automates generation of PXE boot initramfs payload
17-
* **Workspace** - A build directory created by Jenkins for a specific job. Test-agents can have multiple workspaces, one for each job.
18-
19-
# Architecture
20-
21-
![Zephyr CI Block Diagram](zephyrCI-block-diagrams-WW08-2021.png "zephyr CI block diagram WW08 2021")
1+
# Intel 1RTOS / Zephyr internal CI repo
2+
*a catch-all for DevOps services & documentation*
3+
4+
**Contact: email to: FMOS_DevOps, cc: Vondrachek, Chris & Graydon, Connor**
5+
6+
## hidden.tar.secret & accessing the hidden/ directory
7+
DevOps infrastructure secrets & private configuration data is stored encrypted as hidden.tar.secret with access controlled by a GPG keyring.
8+
9+
### To reveal contents of hidden.tar.secret into hidden/ :
10+
1. Your public GPG key must be enrolled in the keyring in this repo.
11+
2. Use our automation script to decrypt hidden.tar.secret & decompress to hidden/
12+
13+
````[email protected]/ $ ./reveal-hidden.sh````
14+
15+
3. Access protected files at hidden/
16+
4. If any changes are made, you MUST run ./hide-hidden.sh to capture changes & encrypt
17+
18+
### To hide the contents of hidden/ & stage hidden.tar.secret for commit:
19+
1. Your public GPG key must be enrolled in the keyring in this repo.
20+
2. Use our automation script to tar & encrypt hidden/, and also stage the change for commit:
21+
22+
````[email protected]/ $ ./hide-hidden.sh````
23+
24+
3. Commit changes to hidden.tar.secret & push per usual
25+
26+
## Useful Links
27+
### [ci.git/docs](docs/) - more DevOps documentation
28+
### [Zephyr DevOps Overview.pptx](https://intel-my.sharepoint.com/:p:/p/christopher_g_turner/EfZ2TF9ElydPjpGBEAKiUkwBiFt5LFBZPI2aGO_HZnP7Wg?e=Bxeeho) - Permalink for our most-often presented slide-deck
29+
30+
# Block Diagram
31+
32+
![Zephyr CI Block Diagram](zephyrCI-block-diagram-WW36-2021.png "zephyr CI block diagram WW36 2021")

allowlist/sanitycheck-master.allowFail

Lines changed: 0 additions & 8 deletions
This file was deleted.

allowlist/sanitycheck-v1.14-branch-intel.allowFail

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Zepyhr DevOps Hypervisor Operations
2+
3+
## A. Summary
4+
5+
DevOps operates a single VMware ESXI 6.7 hypervisor on jfsotc17 that is tasked with CI & test automation for Intel's internal Zephyr project efforts.
6+
7+
## B. Accessing Hypervisor
8+
9+
The hypervisor is not directly connected to the Intel intranet. To access you must be connected to our secured TestNet or use SSH tunneling to expose the https services on your local machine:
10+
11+
From remote:
12+
~~~~
13+
ssh -L 4430:192.168.0.254:443 zephyr-ci.jf.intel.com
14+
https://127.0.0.1:4430
15+
~~~~
16+
From TestNet (direct connection in lab):
17+
~~~~
18+
https://192.168.0.254:443
19+
~~~~
20+
21+
The hypervisor is also accessible via SSH from TestNet for CLI operations
22+
23+
### ACL
24+
25+
root account should not be used
26+
27+
User accounts for DevOps engineers are created manually.
28+
29+
## C. VM Control ( power on/off, reset )
30+
31+
1. Notify users of reboot/downtime. If this is a production VM, clear operation with FMOS_DevOps
32+
2. Access ESXi UI per instructions in **B** above
33+
3. Select the VM instance you'd like to control
34+
4. Click the "Actions" gear & select operation. If the option you require is grayed-out, contact FMOS_DevOps for permissions.
35+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Zephyr DevOps Jenkins Configuration Specification
2+
**Purpose**
3+
This docs aims to serve as as standard-operating-procedure for deploying & configuring Jenkins for internal zephyr production use.
4+
5+
**Target Audience**
6+
DevOps Engineers
7+
8+
**Doc Change Process**
9+
* Minor changes & documentation improvements may be submitted by anyone.
10+
* Major policy or configuration changes should be RFC'd @ FMOS_DevOps first.
11+
12+
**NOTE THIS DOC IS WIP & CHANGE POLICY IS NOT ACTIVE**
13+
14+
## Zephyr DevOps Jenkins Configuration Standard
15+
16+
### 0. Jenkins Service Options + SSL Config
17+
18+
#### Request/download .jks from https://certs.intel.com/aperture**
19+
20+
#### Edit /etc/default/jenkins:
21+
22+
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --httpsPort=8443 --httpsKeyStore=/srv/jenkins/ssl/<machine>.intel.com.jks --httpsKeyStorePassword=<passwd>
23+
24+
#### Re-direct port 443 connections to 8443
25+
sudo iptables -I INPUT 1 -p tcp --dport 8443 -j ACCEPT
26+
sudo iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
27+
sudo iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT
28+
sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
29+
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
30+
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443
31+
sudo apt-get install iptables-persistent
32+
33+
### 1. System-Wide Environment Variables
34+
35+
**Rule:** Don't use system-wide environment variables (those specified in the "Manage Jenkins" configuration). Env should always been handled in the pipeline code or job runners.
36+
37+
**Exception:** Site or deployment specifics such as locale, for example:
38+
~~~~
39+
LANG=en_US.UTF-8
40+
PYTHONIOENCODING=UTF-8
41+
LANGUAGE=en_US:en
42+
LC_ALL=en_US.UTF-8
43+
~~~~
44+
45+
### 2. Plugins
46+
47+
**Rule:** In order to reduce DevOps cycles required for updates & overall CI execution risk, only install plug-ins from [approved list](https://gitlab.devtools.intel.com/zephyrproject-rtos/devops/infrastructure/ansible-playbooks/-/blob/current/jenkins-plugins.yaml)
48+
49+
### 3. Users/Security
50+
51+
**Option 1 - IT VAS + Jenkins PAM**
52+
53+
If Jenkins is executing on a system with functional IT VAS, select 'Unix user/group database' as Jenkins Security Realm. This will restrict logins to accounts in /etc/passwd. This means that users wishing to access the Jenkins UI must have first logged in over SSH for VAS to pickup their idsid & create a /etc/passwd entry.
54+
55+
**Option 2 - IT SAML**
56+
57+
TBD...
58+
59+
### 4. Jenkins Job Statuses
60+
61+
Jenkins implements status conditions to represent the global status of a build: SUCCESS, UNSTABLE, FAILURE, NOT_BUILT or ABORTED. Zephyr DevOps maps these statues to Zephyr CI/Automation jobs as follows:
62+
63+
**SUCCESS** - All tasks defined by job executed & returned success exit codes.
64+
65+
**UNSTABLE** - All tasks defined by job executed but at least one step returned non-zero exit code.
66+
67+
**FAILURE** - At least one task defined by job failed to execute.
68+
69+
**ABORTED** - Job was aborted either by a user or timeout.
70+
71+
**NOT_BUILT** - Unused currently.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Zephyr DevOps Gitlab Plugin Info & Configuration
2+
3+
**Purpose**
4+
This docs provides background information & configuration guidance for implementing Jenkins-Gitlab CI leveraging the gitlab plugin.
5+
6+
**Target Audience**
7+
DevOps Engineers
8+
9+
**Doc Change Process**
10+
* Minor changes & documentation improvements may be submitted by anyone.
11+
* Major policy or configuration changes should be RFC'd @ FMOS_DevOps first.
12+
13+
## 1. Gitlab Plugin Parameters & Jenkins Jobs
14+
15+
RTM @ https://plugins.jenkins.io/gitlab-plugin/#parameter-configuration
16+
17+
When a merge-request is opened on a project configured with Jenkins integration enabled, gitlab automatically transmits variables that specify the merge source repo & branch in the JSON webhook payload. DevOps also operates manually triggered jobs that allow user-provided parameters via the "Build with Parameters" option in Jenkins.
18+
19+
In order for these methods to coexist in the same job, we must support different paths for manual & automated execution:
20+
1.) automated trigger via gitlab plugin with gitlabSrcBranch & gitlabSrcRepo vars provided.
21+
2.) manual trigger w/ user-provided srcBranch & srcRepo from “Build with Parameters” function.
22+
23+
When the MRV starts, it first populates vars from the job parameters into srcRepo + srcBranch:
24+
~~~~
25+
//default to override values from Jenkins Job "Build with Parameters" dialog
26+
def srcRepo="${env.overrideSourceRepo}"
27+
def srcBranch="${env.overrideSourceBranch}"
28+
~~~~
29+
30+
Then we check for gitlab… vars & if set from a plugin trigger, use those instead
31+
32+
~~~~
33+
//now override with gitlab-webhook supplied values, if they exist
34+
if (env.gitlabSourceBranch)
35+
{
36+
echo "Triggered by gitlab merge-request webhook"
37+
srcBranch="${env.gitlabSourceBranch}"
38+
srcRepo="${env.gitlabSourceRepoSshUrl}"
39+
}
40+
~~~~
41+
42+
At this point, the job can continue with srcBranch & srcRepo set correctly for either manual or automated triggers.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Zephyr DevOps Python Dependency Method
2+
**Purpose**
3+
This doc describes how Python dependencies are managed on DevOps infrastructure.
4+
5+
**Target Audience**
6+
DevOps Engineers
7+
8+
**Doc Change Process**
9+
* Minor changes & documentation improvements may be submitted by anyone.
10+
* Major policy or configuration changes should be RFC'd @ FMOS_DevOps first.
11+
## Overview
12+
13+
Zephyr DevOps maintains separate Python dependency sets for each Zephyr build-environment. For example:
14+
15+
v1.14-branch - west 0.6.3, cmake 13.3, located at /usr/local_v1.14-branch
16+
17+
v2.5-branch - west <tbd>, cmake <tbd>, located at /usr/local_v2.5-branch
18+
19+
master - west <latest>, cmake <latest>, located at /usr/local_master
20+
21+
22+
## Quick-start: Python dep install/update on DevOps VMs
23+
24+
**0.** For production, schedule down-time for the VMs that you wish to update. For staging, simply clear update plans with other DevOps engineers via email or Teams chat.
25+
26+
**1.** Confirm target environment is free of any existing Python packages installed under /usr/local.
27+
28+
**2.** Run ansible playbook [nativeBuild02-pythonDeps.yaml](https://gitlab.devtools.intel.com/zephyrproject-rtos/devops/infrastructure/ansible-playbooks/-/blob/current/nativeBuild02-pythonDeps.yaml) with *'--limit=target.machine.intel.com'* to restrict actions to a single host.
29+
30+
## Troubleshooting
31+
32+
### West fails on "import west.main"
33+
34+
This most often occurs on the Jenkins instances where users are likely to run 'sudo pip3 install <package>' which results in packages being installed under /usr/local & thus conflicting with packages ** **Make sure no depDon't use system-wide environment variables (those specified in the "Manage Jenkins" configuration). Env should always been handled in the pipeline code or job runners.

0 commit comments

Comments
 (0)