Jump to: navigation, search

Difference between revisions of "StarlingX/Developer Guide"

m (Development Environment Setup)
Line 41: Line 41:
  
 
<source lang="sh">$ sudo apt-get install git
 
<source lang="sh">$ sudo apt-get install git
</source></li></ol>
+
</source></li>
<ol start="2">
 
 
<li><p>Install the required Docker CE packages in an Ubuntu host system. See [https://docs.docker.com/install/ Get Docker] for more information.</p></li>
 
<li><p>Install the required Docker CE packages in an Ubuntu host system. See [https://docs.docker.com/install/ Get Docker] for more information.</p></li>
 
<li><p>Install the required Android Repo Tool in an Ubuntu host system. See [https://source.android.com/setup/build/downloading#installing-repo Installing Repo] for more information.</p></li></ol>
 
<li><p>Install the required Android Repo Tool in an Ubuntu host system. See [https://source.android.com/setup/build/downloading#installing-repo Installing Repo] for more information.</p></li></ol>
Line 48: Line 47:
 
=== Install Public SSH Key===
 
=== Install Public SSH Key===
  
* [https://help.github.com/articles/connecting-to-github-with-ssh Generate a Public SSH Key]
+
# Follow these instructions on GitHub to [https://help.github.com/articles/connecting-to-github-with-ssh Generate a Public SSH Key] and then upload your public key to your GitHub and Gerrit account profiles:
** [https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account Upload to Github]
+
#* [https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account Upload to Github]
** [https://review.openstack.org/#/settings/ssh-keys Upload to Gerrit]
+
#* [https://review.openstack.org/#/settings/ssh-keys Upload to Gerrit]
  
 
=== Install stx-tools project ===
 
=== Install stx-tools project ===
Line 75: Line 74:
  
 
<source lang="sh">$ cd stx-tools/centos-mirror-tools/
 
<source lang="sh">$ cd stx-tools/centos-mirror-tools/
</source></li></ol>
+
</source></li>
<ol start="2">
 
 
<li>If necessary you might have to set http/https proxy in your Dockerfile before building the docker image.
 
<li>If necessary you might have to set http/https proxy in your Dockerfile before building the docker image.
  
Line 83: Line 81:
 
     ftp_proxy "http://your.actual_ftp_proxy.com:your_port"
 
     ftp_proxy "http://your.actual_ftp_proxy.com:your_port"
 
RUN echo "proxy=http://your-proxy.com:port" >> /etc/yum.conf
 
RUN echo "proxy=http://your-proxy.com:port" >> /etc/yum.conf
</source></li></ol>
+
</source></li>
<ol start="3">
 
 
<li>Build your ''&lt;name&gt;:&lt;tag&gt;'' base container image with '''e.g.''' ''aarcemor:centos-mirror-repository''
 
<li>Build your ''&lt;name&gt;:&lt;tag&gt;'' base container image with '''e.g.''' ''aarcemor:centos-mirror-repository''
  
 
<source lang="sh">$ docker build -t aarcemor:centos-mirror-repository -f Dockerfile .
 
<source lang="sh">$ docker build -t aarcemor:centos-mirror-repository -f Dockerfile .
</source></li></ol>
+
</source></li>
<ol start="4">
 
 
<li>Launch a ''&lt;name&gt;'' docker container using previously created Docker base container image ''&lt;name&gt;:&lt;tag&gt;'' '''e.g.''' ''aarcemor-centos-mirror-repository''. As /localdisk is defined as the workdir of the container, the same folder name should be used to define the volume. The container will start to run and populate a logs and output folders in this directory. The container shall be run from the same directory where the other scripts are stored.
 
<li>Launch a ''&lt;name&gt;'' docker container using previously created Docker base container image ''&lt;name&gt;:&lt;tag&gt;'' '''e.g.''' ''aarcemor-centos-mirror-repository''. As /localdisk is defined as the workdir of the container, the same folder name should be used to define the volume. The container will start to run and populate a logs and output folders in this directory. The container shall be run from the same directory where the other scripts are stored.
  
 
<source lang="sh">$ docker run -itd --name aarcemor-centos-mirror-repository -v $(pwd):/localdisk aarcemor:centos-mirror-repository bash
 
<source lang="sh">$ docker run -itd --name aarcemor-centos-mirror-repository -v $(pwd):/localdisk aarcemor:centos-mirror-repository bash
</source></li></ol>
+
</source></li>
<ol start="5">
 
 
<li>Execute the ''&lt;name&gt;'' docker container '''e.g.''' ''aarcemor-centos-mirror-repository''
 
<li>Execute the ''&lt;name&gt;'' docker container '''e.g.''' ''aarcemor-centos-mirror-repository''
  
Line 113: Line 108:
  
 
<source lang="none"># bash download_mirror.sh
 
<source lang="none"># bash download_mirror.sh
</source></li></ol>
+
</source></li>
<ol start="2">
 
 
<li>Monitor the download of packages until it is complete. When download is complete, the following message is displayed:
 
<li>Monitor the download of packages until it is complete. When download is complete, the following message is displayed:
  
Line 132: Line 126:
 
<source lang="none"># cat output/3rd_rpms_missing_L1.txt output/3rd_srpms_missing_L1.txt output/centos_rpms_missing_L1.txt output/centos_srpms_missing_L1.txt
 
<source lang="none"># cat output/3rd_rpms_missing_L1.txt output/3rd_srpms_missing_L1.txt output/centos_rpms_missing_L1.txt output/centos_srpms_missing_L1.txt
 
# cat output/3rd_rpms_fail_move_L1.txt output/3rd_srpms_fail_move_L1.txt output/centos_rpms_fail_move_L1.txt output/centos_srpms_fail_move_L1.txt
 
# cat output/3rd_rpms_fail_move_L1.txt output/3rd_srpms_fail_move_L1.txt output/centos_rpms_fail_move_L1.txt output/centos_srpms_fail_move_L1.txt
</source></li></ol>
+
</source></li>
<ol start="2">
 
 
<li><p>In case there are missing or failed ones due to network instability (or timeout), you should download them manually, to assure you get all RPMs listed in &quot;rpms_from_3rd_parties.lst&quot; and &quot;rpms_from_centos_repo.lst&quot;.</p></li>
 
<li><p>In case there are missing or failed ones due to network instability (or timeout), you should download them manually, to assure you get all RPMs listed in &quot;rpms_from_3rd_parties.lst&quot; and &quot;rpms_from_centos_repo.lst&quot;.</p></li>
 
<li><p>After all packages were succesfully downloaded, remove all i686 RPMs packages and change ''output'' directory ownership:</p>
 
<li><p>After all packages were succesfully downloaded, remove all i686 RPMs packages and change ''output'' directory ownership:</p>
Line 146: Line 139:
  
 
<source lang="sh">$ mkdir -p $HOME/starlingx/mirror/CentOS/
 
<source lang="sh">$ mkdir -p $HOME/starlingx/mirror/CentOS/
</source></li></ol>
+
</source></li>
<ol start="2">
 
 
<li>Copy the built CentOS Mirror Repository built under ''&lt;stx-tools&gt;/centos-mirror-tool'' to the ''$HOME/starlingx/mirror/CentOS'' workspace directory.
 
<li>Copy the built CentOS Mirror Repository built under ''&lt;stx-tools&gt;/centos-mirror-tool'' to the ''$HOME/starlingx/mirror/CentOS'' workspace directory.
  

Revision as of 14:41, 21 June 2018

This section contains the steps for building a StarlingX ISO.

Requirements

The recommended minimum requirements include:

Hardware Requirements

A workstation computer with:

  • Processor: x86_64 only supported architecture
  • Memory: At least 32GB RAM
  • Hard Disk: 100GB HDD
  • Network: Network adapter with active Internet connection

Software Requirements

A workstation computer with:

  • Operating System: Ubuntu 16.04 LTS 64-bit
  • Docker
  • Android Repo Tool
  • Proxy Settings Configured (If Required)
  • Public SSH Key

Development Environment Setup

This section describes how to set up a StarlingX development system on a workstation computer. After completing these steps, you will be able to build a StarlingX ISO image on the following Linux distribution:

  • Ubuntu 16.04 LTS 64-bit

Update Your Operating System

Before proceeding with the build, ensure your OS is up to date. You’ll first need to update the local database list of available packages:

$ sudo apt-get update

Installation Requirements and Dependencies

  1. Install the required packages in an Ubuntu host system with:
    $ sudo apt-get install git
    
  2. Install the required Docker CE packages in an Ubuntu host system. See Get Docker for more information.

  3. Install the required Android Repo Tool in an Ubuntu host system. See Installing Repo for more information.

Install Public SSH Key

  1. Follow these instructions on GitHub to Generate a Public SSH Key and then upload your public key to your GitHub and Gerrit account profiles:

Install stx-tools project

  1. Clone the <stx-tools> project
    $ git clone git://git.openstack.org/openstack/stx-tools
    

Create a Workspace Directory

  1. Create a starlingx workspace directory on your workstation computer. Usually, you’ll want to create it somewhere under your user’s home directory.
    $ mkdir -p $HOME/starlingx/
    

Build the CentOS Mirror Repository

This section describes how to build the CentOS Mirror Repository.

Setup Repository Docker Container

  1. Navigate to the <stx-tools>/centos-mirror-tool project directory:
    $ cd stx-tools/centos-mirror-tools/
    
  2. If necessary you might have to set http/https proxy in your Dockerfile before building the docker image.
    ENV http_proxy  "http://your.actual_http_proxy.com:your_port" && \
        https_proxy "https://your.actual_https_proxy.com:your_port" && \
        ftp_proxy "http://your.actual_ftp_proxy.com:your_port"
    RUN echo "proxy=http://your-proxy.com:port" >> /etc/yum.conf
    
  3. Build your <name>:<tag> base container image with e.g. aarcemor:centos-mirror-repository
    $ docker build -t aarcemor:centos-mirror-repository -f Dockerfile .
    
  4. Launch a <name> docker container using previously created Docker base container image <name>:<tag> e.g. aarcemor-centos-mirror-repository. As /localdisk is defined as the workdir of the container, the same folder name should be used to define the volume. The container will start to run and populate a logs and output folders in this directory. The container shall be run from the same directory where the other scripts are stored.
    $ docker run -itd --name aarcemor-centos-mirror-repository -v $(pwd):/localdisk aarcemor:centos-mirror-repository bash
    
  5. Execute the <name> docker container e.g. aarcemor-centos-mirror-repository
    $ docker exec -it aarcemor-centos-mirror-repository bash
    

Import GPG Keys

  1. Inside the docker container, import the keys into the local GPG keyring and query public key information:
    # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
    # rpm -qi gpg-pubkey-\*

Download Packages

  1. Enter the following command to download the required packages to populate the CentOS Mirror Repository:
    # bash download_mirror.sh
  2. Monitor the download of packages until it is complete. When download is complete, the following message is displayed:
    totally 17 files are downloaded!
    step #3: done successfully
    IMPORTANT: The following 3 files are just bootstrap versions. Based on them, the workable images
    for StarlingX could be generated by running "update-pxe-network-installer" command after "build-iso"
        - out/stx-r1/CentOS/pike/Binary/LiveOS/squashfs.img
        - out/stx-r1/CentOS/pike/Binary/images/pxeboot/initrd.img
        - out/stx-r1/CentOS/pike/Binary/images/pxeboot/vmlinuz

Verify Packages

  1. Verify there are no missing or failed packages:
    # cat output/3rd_rpms_missing_L1.txt output/3rd_srpms_missing_L1.txt output/centos_rpms_missing_L1.txt output/centos_srpms_missing_L1.txt
    # cat output/3rd_rpms_fail_move_L1.txt output/3rd_srpms_fail_move_L1.txt output/centos_rpms_fail_move_L1.txt output/centos_srpms_fail_move_L1.txt
  2. In case there are missing or failed ones due to network instability (or timeout), you should download them manually, to assure you get all RPMs listed in "rpms_from_3rd_parties.lst" and "rpms_from_centos_repo.lst".

  3. After all packages were succesfully downloaded, remove all i686 RPMs packages and change output directory ownership:

    # find ./output -name "*.i686.rpm" | xargs rm -f
    # chown 751:751 -R ./output

Create CentOS Mirror Repository

  1. From a console of the workstation, create a mirror/CentOS directory under your starlingx workspace directory:
    $ mkdir -p $HOME/starlingx/mirror/CentOS/
    
  2. Copy the built CentOS Mirror Repository built under <stx-tools>/centos-mirror-tool to the $HOME/starlingx/mirror/CentOS workspace directory.
    $ cp -r stx-tools/centos-mirror-tools/output/stx-r1/ $HOME/starlingx/mirror/CentOS/
    

Work in Progress...