vm_based_simulator_sources.md 2.71 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
<table style="border-collapse: collapse; border: none;">
  <tr style="border-collapse: collapse; border: none;">
    <td style="border-collapse: collapse; border: none;">
      <a href="http://www.openairinterface.org/">
         <img src="../../doc/images/oai_final_logo.png" alt="" border=3 height=50 width=150>
         </img>
      </a>
    </td>
    <td style="border-collapse: collapse; border: none; vertical-align: center;">
      <b><font size = "5">OAI CI Virtual-Machine-based Simulator OAI source management</font></b>
    </td>
  </tr>
</table>

## Table of Contents ##

1.  [Introduction](#1-introduction)
2.  [Centralized Workspace](#2-centralized-workspace)
3.  [Create the ZIP file](#3-create-the-zip-file)

# 1. Introduction #

The idea of this section is to optimize/uniform source management for several VM instances.

If we were cloning the same repository in each VM we are creating, we would put so much pressure on the central GitLab repository.

The solution:

* clone/fetch on a given clean workspace and tar/zip only the source files without any artifacts.
* we then copy the tar/zip file to each VM instance
* and within each VM instance, unzip

# 2. Centralized Workspace #

You can create a brand new workspace by cloning:

```bash
$ mkdir /tmp/CI-raphael
$ cd /tmp/CI-raphael
$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git .
$ git checkout develop
```

You can also use your current cloned workspace and any `develop`-based branch.

```bash
$ cd /home/raphael/openairinterface5g
$ git fetch
$ git checkout develop-improved-documentation
# CAUTION: the following command will remove any file that has not already been added to GIT
$ sudo git clean -x -d -ff
$ git status
On branch develop-improved-documentation
Your branch is up-to-date with 'origin/develop-improved-documentation'.
nothing to commit, working directory clean
```

You can also have modified files.

**The main point is to have NO ARTIFACTS from a previous build in your workspace.**

Last point, the workspace folder name is not necesseraly `openairinterface5g`. But all the following commands will be run for the root of the workspace.

For clarity, I will always use `/tmp/CI-raphael` as $WORKSPACE.

# 3. Create the ZIP file #

```bash
# go to root of workspace
$ cd /tmp/CI-raphael
$ zip -r -qq localZip.zip .
```

The **Jenkins Pipeline** performs automatically these operations.

In addition, in case of a merge request, it tries to merge with the target branch and might create a dummy local commit.

See [section](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-master-job#32-verify-guidelines-stage)

---

82
Next step: [the main scripts](./vm_based_simulator_main_scripts.md)
83

84
You can also go back to the [CI dev main page](./ci_dev_home.md)
85