-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add jenkins e2e jobs #20
Merged
Merged
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8a51273
Add jenkins e2e jobs
hangyan b4d7b3f
Add jenkins e2e jobs
hangyan aba1da2
Update ci git settings
hangyan 797ca10
Adjust timeout settings for e2e ci
hangyan 8c151b2
Remove unused code in e2e script
hangyan 1e47091
Update ci settings for github
hangyan 311694f
Remove unused code in e2e script
hangyan f07a410
Add image pre-load for e2e test
hangyan d5d1997
Update e2e job settings
hangyan 96377d5
Fix markdown lint error
hangyan 64a4eae
Use yq to update config values in e2e config
hangyan 4cb8ef7
Add doc for cred on jenkins server
hangyan 0434608
Update doc and script for e2e config
hangyan 4b915c4
Update doc for e2e jobs
hangyan ec78067
Update jenkins ci script
hangyan 39a2758
Remove unused code in jenkins ci script
hangyan 1967c19
Update ci jobs config
hangyan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: CLUSTERNAME | ||
name: CLUSTERNAME | ||
namespace: CLUSTERNAMESPACE | ||
spec: | ||
clusterNetwork: | ||
pods: | ||
cidrBlocks: | ||
- 192.168.0.0/16 | ||
controlPlaneRef: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlane | ||
name: CLUSTERNAME | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: VSphereCluster | ||
name: CLUSTERNAME | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: VSphereCluster | ||
metadata: | ||
name: CLUSTERNAME | ||
namespace: CLUSTERNAMESPACE | ||
spec: | ||
controlPlaneEndpoint: | ||
host: CONTROLVIP | ||
port: 6443 | ||
identityRef: | ||
kind: Secret | ||
name: CLUSTERNAME | ||
server: VCENTERNAME | ||
thumbprint: THUMBPRINTVALUE | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: VSphereMachineTemplate | ||
metadata: | ||
name: CLUSTERNAME | ||
namespace: CLUSTERNAMESPACE | ||
spec: | ||
template: | ||
spec: | ||
cloneMode: linkedClone | ||
datacenter: DATACENTERNAME | ||
datastore: DATASTORE | ||
diskGiB: 25 | ||
folder: VMFOLDERNAME | ||
memoryMiB: 8192 | ||
network: | ||
devices: | ||
- dhcp4: true | ||
networkName: NETWORKNAME | ||
numCPUs: 4 | ||
resourcePool: RESOURCEPOOLPATH | ||
server: VCENTERNAME | ||
storagePolicyName: "" | ||
template: OVATEMPLATENAME | ||
thumbprint: THUMBPRINTVALUE | ||
--- | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlane | ||
metadata: | ||
name: CLUSTERNAME | ||
namespace: CLUSTERNAMESPACE | ||
spec: | ||
kubeadmConfigSpec: | ||
files: | ||
- content: | | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
creationTimestamp: null | ||
name: kube-vip | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- args: | ||
- start | ||
env: | ||
- name: vip_arp | ||
value: "true" | ||
- name: vip_leaderelection | ||
value: "true" | ||
- name: vip_address | ||
value: CONTROLVIP | ||
- name: vip_interface | ||
value: eth0 | ||
- name: vip_leaseduration | ||
value: "15" | ||
- name: vip_renewdeadline | ||
value: "10" | ||
- name: vip_retryperiod | ||
value: "2" | ||
image: ghcr.io/kube-vip/kube-vip:v0.3.5 | ||
imagePullPolicy: IfNotPresent | ||
name: kube-vip | ||
resources: {} | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_ADMIN | ||
- SYS_TIME | ||
volumeMounts: | ||
- mountPath: /etc/kubernetes/admin.conf | ||
name: kubeconfig | ||
hostNetwork: true | ||
volumes: | ||
- hostPath: | ||
path: /etc/kubernetes/admin.conf | ||
type: FileOrCreate | ||
name: kubeconfig | ||
status: {} | ||
owner: root:root | ||
path: /etc/kubernetes/manifests/kube-vip.yaml | ||
initConfiguration: | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
name: '{{ ds.meta_data.hostname }}' | ||
joinConfiguration: | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
name: '{{ ds.meta_data.hostname }}' | ||
preKubeadmCommands: | ||
- hostname "{{ ds.meta_data.hostname }}" | ||
- echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts | ||
- echo "127.0.0.1 localhost" >>/etc/hosts | ||
- echo "127.0.0.1 {{ ds.meta_data.hostname }}" >>/etc/hosts | ||
- echo "{{ ds.meta_data.hostname }}" >/etc/hostname | ||
- ip link set eth0 mtu 1442 | ||
useExperimentalRetryJoin: true | ||
users: | ||
- name: capv | ||
sshAuthorizedKeys: | ||
- SSHAUTHORIZEDKEYS | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
machineTemplate: | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: VSphereMachineTemplate | ||
name: CLUSTERNAME | ||
replicas: 1 | ||
version: K8SVERSION | ||
--- | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
name: CLUSTERNAME-md-0 | ||
namespace: CLUSTERNAMESPACE | ||
spec: | ||
template: | ||
spec: | ||
joinConfiguration: | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
name: '{{ ds.meta_data.hostname }}' | ||
preKubeadmCommands: | ||
- hostname "{{ ds.meta_data.hostname }}" | ||
- echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts | ||
- echo "127.0.0.1 localhost" >>/etc/hosts | ||
- echo "127.0.0.1 {{ ds.meta_data.hostname }}" >>/etc/hosts | ||
- echo "{{ ds.meta_data.hostname }}" >/etc/hostname | ||
- ip link set eth0 mtu 1442 | ||
users: | ||
- name: capv | ||
sshAuthorizedKeys: | ||
- SSHAUTHORIZEDKEYS | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: CLUSTERNAME | ||
name: CLUSTERNAME-md-0 | ||
namespace: CLUSTERNAMESPACE | ||
spec: | ||
clusterName: CLUSTERNAME | ||
replicas: 2 | ||
selector: | ||
matchLabels: {} | ||
template: | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: CLUSTERNAME | ||
spec: | ||
bootstrap: | ||
configRef: | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
name: CLUSTERNAME-md-0 | ||
clusterName: CLUSTERNAME | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: VSphereMachineTemplate | ||
name: CLUSTERNAME | ||
version: K8SVERSION | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: CLUSTERNAME | ||
namespace: CLUSTERNAMESPACE | ||
stringData: | ||
password: CLUSTERPASSWORD | ||
username: CLUSTERUSERNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"apiVersion": "v1", | ||
"kind": "Namespace", | ||
"metadata": { | ||
"name": "CLUSTERNAMESPACE", | ||
"labels": { | ||
"antrea-ci": "true" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
projects.registry.vmware.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Theia CI: Jenkins | ||
|
||
## Reasons for Jenkins | ||
|
||
We have tests as Github Actions but Jenkins allows tests running on a cluster of | ||
multiple nodes and offers better environment setup options. | ||
|
||
## List of Jobs | ||
|
||
| Job Name | Description | Trigger Phase | | ||
hangyan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|----------|------------------------------------------------|-----------------| | ||
| theia-e2e-for-pull-request | Run e2e test for pull request | `/theia-test-e2e` | | ||
|
||
|
||
|
||
## Requirements | ||
|
||
Yaml files under [ci/jenkins/jobs](/ci/jenkins/jobs) can be generated via | ||
jenkins-job-builder. If you want to try out the tests on your local jenkins | ||
setup, please notice the following requirements: | ||
|
||
* Jenkins setup | ||
* Plugins: ghprb, throttle-concurrents | ||
* Install | ||
[jenkins-job-builder](https://docs.openstack.org/infra/jenkins-job-builder/index.html) | ||
* Define your `ANTREA_GIT_CREDENTIAL` which is the credential for your private | ||
repo | ||
* Define your `ghpr_auth`, `antrea_admin_list`, `antrea_org_list` and | ||
`antrea_white_list` as | ||
[defaults](https://docs.openstack.org/infra/jenkins-job-builder/definition.html#defaults) | ||
variables in a separate file | ||
|
||
### Apply the jobs | ||
|
||
Run the command to test if jobs can be generated correctly. | ||
|
||
```bash | ||
jenkins-jobs test -r ci/jenkins/jobs | ||
``` | ||
|
||
Run the command to apply these jobs. | ||
|
||
```bash | ||
jenkins-jobs update -r ci/jenkins/jobs | ||
edwardbadboy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
|
||
## Tips for Developer | ||
|
||
* [macro.yaml](/ci/jenkins/jobs/macros.yaml): Use "{{}}" instead of "{}" in "builder-list-tests" and "builder-conformance". | ||
hangyan marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
- job-template: | ||
name: '{name}-{test_name}-for-pull-request' | ||
node: '{node}' | ||
block-downstream: false | ||
block-upstream: false | ||
builders: '{builders}' | ||
concurrent: false | ||
description: '{description}' | ||
project-type: freestyle | ||
properties: | ||
- build-discarder: | ||
artifact-days-to-keep: -1 | ||
artifact-num-to-keep: -1 | ||
days-to-keep: 7 | ||
num-to-keep: 30 | ||
- github: | ||
url: 'https://github.com/{org_repo}' | ||
publishers: '{publishers}' | ||
scm: | ||
- git: | ||
branches: '{branches}' | ||
credentials-id: '{git_credentials_id}' | ||
name: origin | ||
refspec: +refs/heads/*:refs/remotes/origin/* +refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/* | ||
url: 'https://github.com/{org_repo}' | ||
wipe-workspace: true | ||
triggers: | ||
- github-pull-request: | ||
admin-list: '{admin_list}' | ||
allow-whitelist-orgs-as-admins: '{allow_whitelist_orgs_as_admins}' | ||
auth-id: '{ghpr_auth}' | ||
auto-close-on-fail: false | ||
build-desc-template: null | ||
github-hooks: true | ||
only-trigger-phrase: '{only_trigger_phrase}' | ||
org-list: '{org_list}' | ||
permit-all: '{trigger_permit_all}' | ||
trigger-phrase: '{trigger_phrase}' | ||
white-list-target-branches: '{white_list_target_branches}' | ||
white-list: '{white_list}' | ||
status-context: '{status_context}' | ||
status-url: '{status_url}' | ||
success-status: '{success_status}' | ||
failure-status: '{failure_status}' | ||
error-status: '{error_status}' | ||
triggered-status: '{triggered_status}' | ||
started-status: '{started_status}' | ||
wrappers: '{wrappers}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- builder: | ||
name: builder-e2e | ||
builders: | ||
- shell: |- | ||
#!/usr/bin/env bash | ||
set -ex | ||
DOKCER_REGISTRY="$(head -n1 ci/docker-registry)" | ||
chmod a+x ci/jenkins/test-vmc.sh | ||
./ci/jenkins/test-vmc.sh --cluster-name "$BUILD_TAG" --registry "${DOCKER_REGISTRY}" --username "${CAPVC_USERNAME}" --password "${CAPVC_PASSWORD}" --testcase e2e |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change antrea-ci to theia-ci.