Skip to content

Commit

Permalink
issue: Add CI dir
Browse files Browse the repository at this point in the history
Signed-off-by: Iftah Levi <[email protected]>
  • Loading branch information
iftahl committed Dec 18, 2023
1 parent fa72b3c commit d14cb41
Show file tree
Hide file tree
Showing 26 changed files with 1,683 additions and 344 deletions.
8 changes: 8 additions & 0 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/groovy

// load pipeline functions
// Requires pipeline-github-lib plugin to load library from github
@Library('github.com/Mellanox/ci-demo@stable')
def matrix = new com.mellanox.cicd.Matrix()

matrix.main()
65 changes: 65 additions & 0 deletions .ci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Continuous Integration

## Retrigger

Put a comment with "bot:retest"

## More details

After create Pull Request CI runs automatically within 5 mins.
The CI results can be found under link Details on PR page in github.

There are two main sections: Build Artifacts and Blue Ocean.

* Build Artifacts has log files with output each stage.
* On Blue Ocean page you can see a graph with CI steps. Each stage can be success(green) or fail(red).

## CI/CD

This CD/CD pipeline based on ci-demo. All information can be found in main ci-demo repository.
This is Jenkins CI/CD based project. You can create custom workflows to automate your project software life cycle process.

You need to configure workflows using YAML syntax, and save them as workflow files in your repository.
Once you've successfully created a YAML workflow file and triggered the workflow - Jenkins parse flow and execute it.

[Read more](https://github.com/Mellanox/ci-demo/blob/master/README.md)

## Update Jenkins

If proj_jjb.yaml was changed pipline configuration should be updated

```
cd .ci
make jjb
```

## Job Matrix yaml

The main CI steps are described in `job_matrix.yaml` file.
Full list of supported features and syntax is given below.
For more information please refer to [official ci-demo repository](https://github.com/Mellanox/ci-demo/)

## How to run Docker image on local machine
1. Make sure you have docker engine installed: `docker --version`
2. If there is no docker, please install it this way ):
```sh
apt update && apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -sSL https://get.docker.com/ | sh
```
3. Pull and run container by the following command (use correct image for your case):
```sh
# Find top level dir of the git project:
WORKSPACE=$(git rev-parse --show-toplevel)
# run ubuntu2004 image on x86_64:
docker run -it -d --rm --privileged -e WORKSPACE=$WORKSPACE -v $WORKSPACE:$WORKSPACE -v /var/lib/hugetlbfs:/var/lib/hugetlbfs --ulimit memlock=819200000:819200000 -v /auto/mtrswgwork:/auto/mtrswgwork -v /hpc/local/commercial:/hpc/local/commercial -v /auto/sw_tools/Commercial:/auto/sw_tools/Commercial -v /hpc/local/etc/modulefiles:/hpc/local/etc/modulefiles harbor.mellanox.com/swx-infra/x86_64/ubuntu20.04/builder:mofed-5.2-2.2.0.0 bash
# run toolbox image on x86_64:
docker run -it -d --rm --privileged -e WORKSPACE=$WORKSPACE -v $WORKSPACE:$WORKSPACE -v /var/lib/hugetlbfs:/var/lib/hugetlbfs --ulimit memlock=819200000:819200000 -v /auto/mtrswgwork:/auto/mtrswgwork -v /hpc/local/commercial:/hpc/local/commercial -v /auto/sw_tools/Commercial:/auto/sw_tools/Commercial -v /hpc/local/etc/modulefiles:/hpc/local/etc/modulefiles harbor.mellanox.com/toolbox/ngci-centos:7.9.2009.2 bash
```
4. Login to running docker image:
```sh
docker exec -it ${IMAGE_NAME} bash
```
Navigate to `$WORKSPACE` directory inside the image

12 changes: 12 additions & 0 deletions .ci/artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -xl

if [ -d jenkins ]; then
gzip -f ./jenkins/*.tar 2>/dev/null || true
cd ./jenkins/ ;
for f in *.tar.gz ; do [ -e "$f" ] && mv "$f" "${flags}/arch-${name}-$f" ; done ;
cd ..
cd ./jenkins/${flags};
for f in *.tap ; do [ -e "$f" ] && mv "$f" "${flags}-${name}-$f" ; done ;
for f in *.xml ; do [ -e "$f" ] && mv "$f" "${flags}-${name}-$f" ; done ;
cd ../..
fi
Loading

0 comments on commit d14cb41

Please sign in to comment.