Commit Graph

49 Commits

Author SHA1 Message Date
Davlet Panech 26bc0d6e00 Lock requests to 2.27.1 for py 2.7 compatibility
Python module "requests" was recently upgraded to version 2.28.0, which
requires Python 3.x. Lock it to last version known to work with Python
2.7.

Closes-Bug: 1978469
Change-Id: Ib478cb5ef0ca94c9f7eb3d7288726f9592f635b6
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-06-13 09:47:37 -04:00
Davlet Panech eec9163e0e Dockerfile: install tox in its own virtualenv
Fix multiple problems with python modules that cause build errors.

* Avoid replacing RPM-owned python modules with pip:
  - Remove python-tox: installed via pip later in Dockerfile
  - Remove python-testrepository: installed via pip later in Dockerfile
    (required by pbr)
  - Add python-virtualenv: was pulled in by one of the removed packages
    above

* builder-constraints.txt: used only for global packages:
  - Move all version constraints of Dockerfile into constraints file
  - Remove filelock and platformdirs packages (required by tox -- see
    below).
  - git-review: downgrade to 1.28.0, latest official version compatible
    with python 2.7

* Install a sane python 2.7 virtual environment that doesn't conflict
  with RPM modules, that includes tox. Create a symlink to tox in
  /usr/bin/. Uses a separate contraints file.

* builder-opt-py27-constraints.txt: new file for the virtualenv in /opt:
  - tox==3.23.0
  - Remove "filelock" and "platformdirs" packages formerly in the
    original constraints file. They resolve correctly by the tox
    requirement. Note that this downgrades the packages slightly compared
    to the explicit requirements, back to the latest official versions
    compatible with python 2.7.

    See revisions starlingx/tools revisions:
        0d67f81bdf
        7bde482bcb

Closes-Bug: 1960675
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I7e3e7e4f4afa52a614cb9f58b2d6172441ea7bc1
2022-02-11 17:00:28 -05:00
Scott Little 7bde482bcb Lock platformdirs to version 2.4.0 to retain python 2.7 support
Platformdirs was upgraded to 2.4.1 from 2.4.0 over the holidays,
and this breaks our build that requires python 2.7 compatibility.
We'll stay with 2.4.0 which has worked for StarlingX for some time,
rather than reverting to 2.0.2 which was the last with official
python 2.7 support.

Closes-Bug: 1956054
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I303429a744f4addf639f1ab88f03a06b52bc7144
2021-12-31 10:57:02 -05:00
Scott Little 0d67f81bdf Lock filelock to version 3.4.0 to retain python 2.7 support
Filelock was upgraded to 3.4.2 from 3.4.0 over the holidays,
and this breaks our build that requires python 2.7 compatibility.
We'll stay with 3.4.0 which has worked for StarlingX for some time,
rather than reverting to 3.2.1 which was the last with official
python 2.7 support.

Closes-Bug: 1956054
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I77e595f7fcf081707da78f2fba8df70bf19033de
2021-12-30 14:18:13 -05:00
Davlet Panech 4b13662f54 Use pyparsing===2.4.7
This is the last version that works with python 2.7

Closes-Bug: 1948697
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Ib9660c1d43f261c091ae1cbf2ccf66f2c7073ce8
2021-10-25 14:27:55 -04:00
Scott Little 42ed522880 Update ca-certificates to pull from Centos 7.9
https download fails with errors such as...

00:21:13.479 ERROR: cannot verify opendev.org's certificate, issued by
‘/C=US/O=Let's Encrypt/CN=R3’:
00:21:13.479   Issued certificate has expired.

The upstream root certificate expire on Oct 1, 2021.

ca-certificates needs to be updated to version 2021.2.50
but that version is only available in Centos 7.9 or newer.
This build container is locked down to Centos 7.8 without
updates.

This update adds repo definitions for 7.9 and 7.8 updates,
but sets them to disabled by default.

When updating ca-certificates I temporarily enable the
Centos 7.9 updates repo.

I also disable the yum module that causes the
"system is not registered with an entitlement server"
messages, but those messages turned out to NOT be the root
cause of ca-certificates failure to update.

Closes-bug: 1946151
Closes-bug: 1946122
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I7ac47582e731ec5003f76ddfa24331ca87e1bf6c
2021-10-06 12:01:27 -04:00
Davlet Panech 080487ff07 lst_utils.sh: increase search depth 3 => 4
- Increase search depth from 3 to 4 for .lst files
- Avoid unnecessary directory scanning

Story: 2009108
Task: 42968

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Idb2204cf5c2517c5aa887dd59255eab9621e7f5f
2021-08-17 09:09:58 -04:00
Scott Little 7b5f3a45e6 fix bad flockflock url pt 2
A stray '}' character found it's way into my prior update
titled 'fix bad flockflock url' after testing. The result was
the following error

sed: -e expression #1, char 15: unexpected `}'

This removes the unwanted '}', restoring the prior update
to its intended form.

Closes-bug: 1926987
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I48f4721ccaf121679916b01747243deedf5836cd
2021-05-05 10:09:50 -04:00
Scott Little b96ebc83d8 fix bad flockflock url
download_mirror.sh fails due to a bad path containing
‘stx-tools/centos-mirror-tools/config/centos/flockflock’

The path is constructed, and the trigger is when an EOL is missing
from a centos_build_layer.cfg file, causing 'cat' to merge the last
line of the offending file with the first line of the next file.

Switch 'cat' to 'grep', which will always ensure an EOL is present.
Along the way, we can filter out empty lines and comments.

Closes-bug: 1926987
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I2404b3415f0f3e2f395c2bcb7a527aa01a488f61
2021-05-04 12:14:36 -04:00
Scott Little 1fd6f3f636 tidy stx/downloads directory
$MY_REPO/stx/downloads contains links to tarballs and other files
relevant to the build.  It is populated by populate_downloads.sh.
On subsequent runs, new links might be added, but old links are
not cleaned up.

Adopt the convention used by generate-centos-repo.sh of moving
the old content under a timestamp backup directory, leaving
an empty directory to re-populate.

Closes-bug: 1908297
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: Ib6c8b782db6c369cb00e8fe8c64be099d7a5d238
2020-12-15 14:17:50 -05:00
Scott Little 451b9513e4 Fix selection of release specific mock prototype
Commit https://review.opendev.org/c/starlingx/root/+/762700
was intended to include the code to select the release specific
mock config prototype.

    e.g. mock.cfg.centos7.proto

As delivered, it would always select the default.

    e.g. mock.cfg.proto

Other improvements:
- remove some trailing whitespace
- improved cleanup of temorary directories

Closes-Bug: 1906547
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: I3e988fb0e861efcf9cd16b8a46b74398dbb1db17
2020-12-09 14:14:05 -05:00
Scott Little e875862d50 Revert "Fix selection of a release specific mock prototype"
This reverts commit 72d1905384.

Reason for revert: Breaks when 'Add support CentOS-8/dnf/mock-2.6 based builds' was reverted from root

Change-Id: I05c337fc8d054253b56b2ed9dba874ca278cbbdd
2020-12-02 20:00:21 +00:00
Scott Little 72d1905384 Fix selection of a release specific mock prototype
Commit https://review.opendev.org/c/starlingx/root/+/762700
was intended to include the code to select the release specific
mock config prototype.

    e.g. mock.cfg.centos7.proto

As delivered, it would always select the default.

    e.g. mock.cfg.proto

When combined with a change in
https://review.opendev.org/c/starlingx/root/+/762701
that prematurely set the default mock cfg prototype
to the Centos 8 version while leaving the build
container at Centos 7, we created a build failure.

Closes-Bug: 1906547
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: If484b1b942d3a4febe5dee0afa01aaf0c00a4a1b
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-12-02 13:05:52 -05:00
Zuul a2514836b1 Merge "Support different mock.cfg.proto files for CentOS-7 vs CentOS-8" 2020-11-25 21:02:58 +00:00
Scott Little c3cb180ae0 generate-local-repo.sh bad ref to root.git
A previous de-branding update inadvertently included a
line intended for the de-branding of cgcs-root to root.
That portion of the debranding effort has been put on indefinite
hold as the 'repo' tool lacks critical features to ease the
transition.

This update reverts the one line change to it's prior state.

Closes-big: 1904908
Change-Id: Ie027d0eb4025611aaf086cfe38fa60535de2865d
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-11-19 15:44:45 -05:00
Scott Little fcf41fb57b Support different mock.cfg.proto files for CentOS-7 vs CentOS-8
We'll be supporting CentOS-7 vs CentOS-8 based build environments
concurrently for a time.  The two distros require slightly
different content in the mock.cfg.

Modify generate-centos-repo.sh to determine which
distribution we are building under, and select the
correct mock.cfg prototype(s).  It will look for files
names mock.cfg.$DISTRO.$LAYER.proto and if found,
substitute them for mock.cfg.$LAYER.proto.

There will be a matching change in the 'root' git to
introduce separate CentOS-7 and CentOS-8 mock prototypes.

Story: 2006729
Change-Id: Ibf610bcd82b447b8ffeecd86595b19280106e458
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-11-13 13:22:04 -05:00
Scott Little 33648c9b34 build-iso failure due to missing repodata
Build-iso started failing due to the lack of
repodata in $MY_REPO/centos-repo/rt/Binary/ .

The problem was traced back to generate-centos-repo.sh
and an unintended modification of the dest_dir global
variable.  The unintended modification was due to
the new function copy_with_backup failing to use
'local' on it's internal variables.

Closes-bug: 1901920
Change-Id: If1c3928518552327af9e01a77b287849a1e3981b
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-10-28 12:26:45 -04:00
Scott Little 44cda9d881 Copy the layer specific mock.cfg prototype file
The current code only copies the default mock.cfg.proto
file. It omits the layer specific file.

If a specific layer is requested, and a layer specific
prototype file exists, it should also be copied.

Change-Id: I582baff3106dc02445785e66a51c9ec283504c45
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-10-27 15:26:36 -04:00
Scott Little 420a989cf5 Add backward compatability wrapper for generate-cgcs-centos-repo.sh
generate-cgcs-centos-repo.sh was renamed generate-centos-repo.sh
in a prior update.  This commit restores the old command
as a wrapper for the renamed command.  This will provide
backward compatability for a time.

Story: 2006387
Task: 36912
Depends-On: https://review.opendev.org/#/c/687403
Change-Id: I69714d46ab20b52828f31625cc4e7955fbd10387
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-09-18 22:32:42 -04:00
Scott Little b827624e16 rename cgcs-centos-repo to centos-repo
Story: 2006387
Task: 36912
Depends-On: https://review.opendev.org/749974
Depends-On: https://review.opendev.org/750041
Change-Id: I745a822e88aca68c207a92f14fb5370d6e3d0050
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-09-18 22:32:41 -04:00
Scott Little 9a188af410 Add backward compatability wrapper for generate-cgcs-tis-repo
generate-cgcs-tis-repo was renamed generate-local-repo.sh
in a prior update.  This commit restores the old command
as a wrapper for the renamed command.  This will provide
backward compatability for a time.

Story: 2006387
Task: 36910
Depends-On: https://review.opendev.org/#/c/687401
Change-Id: Ibe7c70b1b3f1081e3c7c8a1ca775927322653a5b
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-09-18 22:32:41 -04:00
Saul Wold 4e73613a36 Rename cgcs-tis-repo to local-repo
Both the repo and scripts need to be updated for this rename
There is a corresponding change needed to the starlingx/root
repo.

This is tested with a clean build and rebuild to ensure RPMs
are found correctly.

Story: 2006387
Task: 36910
Depends-On: https://review.opendev.org/749974
Depends-On: https://review.opendev.org/750042
Change-Id: I997728f3283077365555eeb9bdbe028ccac255f1
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-09-18 22:32:41 -04:00
Saul Wold 3a26e8510f remove pike from mirror path name
StarlingX has moved beyond the OpenStack pike release and will
be following master and the latest release, so don't include
OpenStack release names.

This also removes the r1 reference from the download directory
path.

Story: 2006835
Task: 37410
Change-Id: I0c548e9c97f2fb162394d0c381f02a40072e7400
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2020-09-16 11:13:31 -04:00
Saul Wold e390e85bd5 generate-cgcs-tis-repo: Fix bashate indent issues
This fixes tox issues that where identified when the debrand
and rename of this script to be a .sh extension.

Change-Id: Ie694e8578c8b75191b60facb723daf4175a8ab87
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2020-08-07 12:46:09 -07:00
Davlet Panech 78263e8784 Dockerfile: pin centos & epel repo versions
Avoid different outcomes every time we run "docker build":

- Use centos 7.8 base image
- Use fixed versions of CentOS & EPEL repos
- Pin mock & its dependencies to 1.4.16
- Don't install unnecessary packages
- Don't install unnecessary/conflicting repo files

Change-Id: Ic9a52f373809ed66a0e61675f4d6276fd62e6fa0
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2020-06-19 15:19:14 -04:00
Scott Little f6755e179a Enable build of docker images, charts and wheels from a layered build
1) Add config for the container layer.

2) Add support for the new config file 'required_layer_wheel_inc.cfg',
Which will specify the default urls for lower layer wheels.inc files.
These files must be downloaded by download_mirror.sh, and linked by
generate-cgcs-centos-repo.sh.

3) Add options to download_mirror.sh and generate-cgcs-centos-repo.sh
allowing overrides or additions to the set of url's for lower layer
wheels.inc

4) Changes to allow build scripts running within a docker container
to launch a sister (not daughter) container.  This will allow
build-wheels to run within a container.

Story: 2006166
Task: 38980
Depends-On: https://review.opendev.org/711773
Depends-On: https://review.opendev.org/717755
Change-Id: I95c71a0327dc9d919ed835d3661a6f1ec7ce30c7
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-04-14 22:00:52 -04:00
Scott Little bbd79fcd38 Fast download of lower layer rpms
The default yumdownloader approach to downloading files
does so one at a time, and is very slow.  Too slow for layered
build which is built around the assumption that files can
be downloaded faster than they can be built.

This update will switch from yumdownloader to reposync
for the download of lower layer rpms.  It exploits the
fact that each layer and build type publishes it's own lst file
of rpms to download.  The lst file is transformed into an'
includepkgs directive in a custom yum.conf which is passed
to reposync, so we only sync the desited rpms.

Reposync won't redownload rpms that it already has, even if the
upstream repodata indicates that the files checksum has changed.
Forceing the redownload of these rpms requires that we manually
download the upstream repodata and that we use verifytree to
identify and delete the new obsolete rpms.

Also including two small bug fixes found while investivgating an
alternative solution to launchpad  1864221.
- incorrect userid in a chown
- Bug in get_url, --url pass being passed in the wrong place

Story: 2006166
Task: 39307
Closes-Bug: 1864221
Change-Id: If12b98ff4f5f24d9318250356920f397419f0f80
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-04-14 16:14:01 -04:00
Saul Wold 6226422aee Remove TC reference from RELEASE Variable and config scripts
This changes a brand specific to be generic for configuration

Story: 2006387
Task: 36914
Change-Id: I826498cfc58b4e02fcdf4590a5cbfc25d38f7fc9
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2020-02-28 10:44:47 -08:00
Scott Little d51f8050cd Build layering, script and lst update
Script changes to download content by layer.
Valid options are 'all', 'compiler', 'distro', 'flock'.

Current .lst and yum files under directory centos-mirror-tools
are relocated.  Generic package dependencies are relocated to
centos-mirror-tools/config/<os>/<layer>/ .

Lst entries for compilable content have been relocated to other
git repos by prior updates.  i.e.  those that list tarballs or
srpms to be compiled within that repo.

The original .lst files are deleted to make it easier
to identify new content during development.

Layer 'all' builds all layers in a single workspace.  The
lst files are identical to current content, minus the src.rpm and
tarball entries.

Other layers get only a subset of packages download. The minimum
required to build the layer.  The 'flock' layer will have additional
content to satisfy the run time requirements as well as the build
time requirements.

An upper layer does not need to list rpms known to be provided by
a lower layer.  Instead the config file 'required_layer_pkgs.cfg'
lists urls for lst files for lower layer build outputs.
These build outputs are generated and published by cengn for
each layer.

A second layer config file, 'required_layer_iso_inc.cfg' lists
image.inc files for lower layer builds.  These build outputs are
generated and published by cengn for each layer, summarizing
the image.inc files found in individual git repos.

Image.inc files inform the build-iso process, listing rpms that
that provide services and commands that need to be included in
the iso.  The transitive list of required rpms need not be listed.

Finally the layer config should include a yum.repos.d
directory in which supplementary yum repos are defined to
pick up cengn built content from lower layers.

To allow a designer to do cross-layer building using local sources
rather than those provided by CENGN, there are several options.

The designer can modify the urls for lower layer build outputs,
as found in the .cfg and .repo files within the config directory
'stx-tools/centos-mirror-tools/config/<distro>/<layer-to-build>'
directly within the git.  Substitute urls can use the file:///
syntax.  Just be sure to remove these changes before submitting.

Alternatively new args have been added to download_mirror.sh,
generate-cgcs-centos-repo.sh and commands that override the
normal config.

The easiest to use is a command argurement that substitutes a new
config directory, replacing stx-tools/centos-mirror-tools/config.
The intent is for the designer to do a recursive copy of that
directory into a side location. make his changes there, outside of
git, and provide the path to that directory as an extra arguement
to download_mirror.sh and generate-cgcs-centos-repo.sh.

e.g. For simplicity I'll only list the 'extra' arguements

download_mirror.sh -C <my-config-dir> \
                   -l <layer> \
                   ...

generate-cgcs-centos-repo.sh --config-dir=<my-config-dir> \
                             --layer=<layer> \
                             ...

populate_downloads.sh --config-dir=<my-config-dir> \
                      --layer=<layer> \
                      ...

These arguements can also be suplied via the environment.
For the purpose of containerized builds, these arguements
should be defined in your localrc.

e.g.
export STX_CONFIG_DIR=<my-config-dir>
export LAYER=<layer>

The final alternative is to override things at a more granular level,
replacing a single lst file of image.inc file.  Here you can replace
a single line found in a required_layer_pkgs.cfg or
required_layer_iso_inc.cfg file.

e.g. We are doing a flock build and want to modify the content picked up
from the distro layer's rt build, and that content delivers a service
we want in the iso.  For simplicity I'll only list the 'extra' arguments

./download_mirror.sh -l flock \
    -L distro,rt,file:///<my-distro-workspace>/rt/rpmbuild/RPMS/rpm.lst \
    -I distro,std,file:///<my-distro-workspace>/rt/image.inc \
    ...

generate-cgcs-centos-repo.sh --layer=flock \
    --layer-pkg-url=distro,rt,file:///<my-distro-workspace>/rt/rpmbuild/RPMS/rpm.lst \
    --layer-inc-url=distro,std,file:////<my-distro-workspace>/rt/image.inc \
    ...

NOTE: The triplet syntax for a package list url is
    <lower-layer>,<build-type>,<url-to-rpm.lst>

    lower-layer: 'compiler', 'distro'
    build-type: 'std', 'rt', 'installer'

    Also if 'file:///' syntax is used, a matching change is made to
    the yum *.repo file.  This assumes that the rpm.lst is co-resident with
    repodata directory, as is the norm for our build outputs.

NOTE: The triplet syntax for a image inc url is
    <lower-layer>,<include-type>,<url-to-image.inc>

    lower-layer: 'compiler', 'distro'
    build-type: 'std', 'dev'

A typical user is likely only working in the flock layer on the master
branch.  He should be content to use the compiler and distro layer
outputs from cengn.

His workflow looks like ...

1, sync code for flock layer
$ repo init -u https://opendev.org/starlingx/manifest.git -b master -m flock.xml
$ repo sync

2, download rpms for flock layer, and populate a local mirror
$ LOCAL_MIRROR=/import/mirrors/starlingx
$ cd stx-tools/centos-mirror-tools
$ ./download_mirror.sh -n -g -c yum.conf.sample -S -l flock
$ cp -r output/stx-r1/CentOS/pike/* $LOCAL_MIRROR/

3, Prepare a virtual repo and downloads directory for building
$ cd ../toCOPY
$ ./generate-cgcs-centos-repo.sh --layer=flock $LOCAL_MIRROR
$ ./populate_downloads.sh --layer=flock $LOCAL_MIRROR

4, rpm package and iso building
$ build-pkgs && build-iso && build-helm-charts.sh

Building all layers in a single workspace is still supported, and
looks identical to the previous workflow.

1, sync code
$ repo init -u https://opendev.org/starlingx/manifest.git -b master
$ repo sync

2, download rpms for flock layer, and populate a local mirror
$ LOCAL_MIRROR=/import/mirrors/starlingx
$ cd stx-tools/centos-mirror-tools
$ ./download_mirror.sh -n -g -c yum.conf.sample -S
$ cp -r output/stx-r1/CentOS/pike/* $LOCAL_MIRROR/

3, create repo named "StxCentos7Distro" for building
$ cd ../toCOPY
$ generate-cgcs-centos-repo.sh $LOCAL_MIRROR
$ populate_downloads.sh $LOCAL_MIRROR

4, rpm package and iso building
$ build-pkgs && build-iso && build-helm-charts.sh

Only a cross-layer developer should setup two or three copies of the
building environment, one per layer.  We suggest you use seperate shells
for each layer, as the various paths (MY_REPO, MY_WORKSPACE ...) need to
be unique,

Shell 1, compiler layer
$ LOCAL_MIRROR=/import/mirrors/starlingx
$ LOCAL_CONFIG=<some-dir>/config
$ MY_REPO_ROOT_DIR=<some-dir>/layer-compiler
$ MY_REPO=$MY_REPO_ROOT_DIR/cgcs-root
$ MY_WORKSPACE=$MY_REPO_ROOT_DIR/workspace
  ...

$ mkdir -p $MY_REPO_ROOT_DIR
$ cd $MY_REPO_ROOT_DIR
$ repo init -u https://opendev.org/starlingx/manifest.git -b master -m compiler.xml
$ cd stx-tools/centos-mirror-tools
$ cp -r config/* $LOCAL_CONFIG
 ... edit urls in *.cfg and *.repo files under $LOCAL_CONFIG ...

$ ./download_mirror.sh -n -g -c yum.conf.sample -S -C $LOCAL_CONFIG -l compiler
$ cp -r output/stx-r1/CentOS/pike/* $LOCAL_MIRROR/
$ cd ../toCOPY
$ ./generate-cgcs-centos-repo.sh --config-dir=$LOCAL_CONFIG --layer=compiler $LOCAL_MIRROR
$ ./populate_downloads.sh --config-dir=$LOCAL_CONFIG --layer=flock $LOCAL_MIRROR
$ build-pkgs

Shell 2, distro layer
$ LOCAL_MIRROR=/import/mirrors/starlingx
$ LOCAL_CONFIG=<some-dir>/config
$ MY_REPO_ROOT_DIR=<some-dir>/layer-distro
$ MY_REPO=$MY_REPO_ROOT_DIR/cgcs-root
$ MY_WORKSPACE=$MY_REPO_ROOT_DIR/workspace
  ...
$ mkdir -p $MY_REPO_ROOT_DIR
$ cd $MY_REPO_ROOT_DIR
$ repo init -u https://opendev.org/starlingx/manifest.git -b master -m distro.xml
$ repo sync
$ cd stx-tools/centos-mirror-tools
$ ./download_mirror.sh -n -g -c yum.conf.sample -S -C $LOCAL_CONFIG -l distro
$ cp -r output/stx-r1/CentOS/pike/* $LOCAL_MIRROR/
$ cd ../toCOPY
$ ./generate-cgcs-centos-repo.sh --config-dir=$LOCAL_CONFIG --layer=distro $LOCAL_MIRROR
$ ./populate_downloads.sh --config-dir=$LOCAL_CONFIG --layer=flock $LOCAL_MIRROR
$ build-pkgs

Shell 3, flock layer
$ LOCAL_MIRROR=/import/mirrors/starlingx
$ LOCAL_CONFIG=<some-dir>/config
$ MY_REPO_ROOT_DIR=<some-dir>/layer-flock
$ MY_REPO=$MY_REPO_ROOT_DIR/cgcs-root
$ MY_WORKSPACE=$MY_REPO_ROOT_DIR/workspace
  ...
$ mkdir -p $MY_REPO_ROOT_DIR
$ cd $MY_REPO_ROOT_DIR
$ repo init -u https://opendev.org/starlingx/manifest.git -b master -m flock.xml
$ repo sync
$ cd stx-tools/centos-mirror-tools
$ ./download_mirror.sh -n -g -c yum.conf.sample -S -C $LOCAL_CONFIG -l flock
$ cp -r output/stx-r1/CentOS/pike/* $LOCAL_MIRROR/
$ cd ../toCOPY
$ ./generate-cgcs-centos-repo.sh --config-dir=$LOCAL_CONFIG --layer=flock $LOCAL_MIRROR
$ ./populate_downloads.sh --config-dir=$LOCAL_CONFIG --layer=flock $LOCAL_MIRROR
$ build-pkgs && build-iso && build-helm-charts.sh

Story: 2006166
Task: 37103

Depends-On: https://review.opendev.org/698756
Depends-On: https://review.opendev.org/700819
Depends-On: https://review.opendev.org/700821
Change-Id: I088020b81f08656e50aa29b5584bbc1dd1378f12
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-02-10 10:45:40 -05:00
Don Penney 12c3dc4772 Constrain more-itertools for build failure
A recent update to the more-itertools python module causes a failure
in the STX_BUILD_container_setup CENGN build job. This module dropped
python-2.7 support after its 5.0.0 release. The newest update causes a
failure due to code that does not work with 2.7.

This commit adds a builder-constraints.txt file that the Dockerfile
passes to the pip install command to constrain module versions during
setup of the build container, allowing us to constrain the
more-itertools version to 5.0.0, the last version to officially
support python 2.7.

Change-Id: I3432c204ecd7c4ddedd8a7dea14216d4ec31e0aa
Closes-Bug: 1859642
Signed-off-by: Don Penney <don.penney@windriver.com>
2020-01-14 11:20:50 -05:00
Saul Wold 73c1d66677 Rename cgcs_overlay to mock_overlay
This helps to debrand (remove cgcs) from the tools area

Story: 2006387
Task: 36208
Change-Id: I357837a710207f8cec6409d1de99f443f8c50c84
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2019-10-08 12:32:50 -07:00
Saul Wold c6bdb70f24 Add definiton of $CREATEREPO
The CREATEREPO variable was not getting set causing the script
to fail, additionally, use the variable consistently instead
of calling createrepo directly.

Closes-Bug: 1846387
Change-Id: If42d5ca14aa9d7ace1d0d6d9daf846a9e51ab559
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2019-10-02 13:40:53 -07:00
Bin Yang 4c63a93d25 fix generate-cgcs-centos-repo.sh error if symbolic links in mirror dir
Change-Id: I1878006bddae117861477c8e0012125e0a60087a
Closes-Bug: 1831702
Signed-off-by: Bin Yang <bin.yang@intel.com>
2019-06-05 15:02:33 +08:00
Don Penney cac209d677 Improve generate-cgcs-centos-repo.sh efficiency
The generate-cgcs-centos-repo.sh utility sets up symlinks
in the cgcs-centos-repo directory for each entry in the
defined LST files, pointing to files from a mirror. In the
processing of the LST files, a complete "find" of the
specified mirror is done for each file, looking for a match.
Given there are more than 2000 such entries, this causes
the tool to take a long time to do its job.

This update enhances the tool to do a single find upfront,
caching the result in a temporary file. During processing of
the LST files, then, the tool can grep this file to find the
corresponding file, rather than repeating the find.

In addition, this update fixes an issue with error reporting,
where a flag was used inside the processing loop to indicate
missing files. However, because the loop runs in a subshell,
this status flag is no longer set when checked outside the loop.
This is replaced with a check of the missing file report.

Change-Id: I0eb41f9da3d5afd010ade9308474e537c409f540
Closes-Bug: 1831488
Signed-off-by: Don Penney <don.penney@windriver.com>
2019-06-03 14:45:28 -04:00
Dean Troyer fda050e571 Followup opendev cleanup and test jobs
Change-Id: Iabab934d95f394af37ce70b3ee63761503fcb847
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-04-21 16:08:20 -05:00
Erich Cordoba e75bb2e7c3 Add notices on Intel authored files.
Story: 2005265
Task: 30095

Change-Id: I9eecbe7c0a15eec2ffe1e43964cd4253fc04b91c
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2019-03-20 10:21:32 -06:00
Shuicheng Lin a6d4b83919 update mellanox driver name with the new version
Mellanox driver has been upgraded to 4.5.1 version in tarball_dl.lst
Need update the name in populate_downloads.sh accordingly.

Story: 2004521
Task: 29193

Change-Id: If4cb097f9ee2027f2e7eb6436057cdd607890f81
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
2019-01-30 23:48:29 +08:00
Jason McKenna e3712f2741 Update populate_downloads to use latest libibverbs
An update to stx-integ (https://review.openstack.org/#/c/591936/)
upreved the version of libibverbs that the build was expecting.
This change uprevs the version which is placed in downloads/ by
populate_downloads.sh to match the expected version.

Change-Id: I5ab727f373fe4c73b73135e6860beb99792537d6
Signed-off-by: jmckenna <jason.mckenna@windriver.com>
Story: 2003508
Task: 24786
2018-08-21 09:14:00 -04:00
Erich Cordoba 6b893381bf Update file names in cgcs-centos-repo generator
The script was updated as the filenames were changed.

Change-Id: I1ef3dae3752cc377a9c9a087628f741b30cb31b5
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2018-08-16 23:27:13 -05:00
jmckenna 13f92f4668 Improved local mirror support in tools
This change improves support for organizational or personal local
mirrors.  Download tools work in a wider variety of environmnets,
and the population of build environments is now driven by .lst
files.

The download_mirror.sh (and related files) now have options to
better support running in non-containerized environments.  This
includes options to run using local yum.conf files (rather than
system files) and not executing sudo or chgrp commands.  These
options are enabled by flags.  Default behaviour remains
unchanged.

The generate-cgcs-centos-repo.sh tool now populates build
environment as driven by lst files.  This allows a mirror to be
maintained (and grown) at an organizational level, while allowing
a developer to produce exactly the environment they need as per
the lst files they have checked out.

generate-cgcs-centos-repo.sh now also populates the downloads
directory by invoking the populate_downloads.sh script (also
driven by lst files)

Change-Id: I8aae32c776df7618a5ef545a0ce43903b41112d0
Story: 2003422
Task: 24586
Signed-off-by: jmckenna <jason.mckenna@windriver.com>
2018-08-13 15:53:43 -04:00
Abraham Arce a1e305a83f Build Container Finish Setup Git Protocol
Using https://git.starlingx.io/stx-XXXX form URLs for git clone
and repo init commands.

Change-Id: I0d0e07bc2f15ce052ee954e0c0698a24f03a7f28
Co-authored-by: Dean Troyer <dtroyer@gmail.com>
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2018-07-27 15:33:09 -05:00
Erich Cordoba 0d1f1f9b9b Copy mock.cfg.proto and comps.xml files into cgcs-centos-repo
Story: 2002936
Task: 23082

Depends-On: https://review.openstack.org/#/c/584214/
Change-Id: Id1015400b3a68f1447d1690bb19da9abb97d4dc5
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2018-07-20 18:15:04 -05:00
Zuul af21d9cf52 Merge "README.md/finishSetup: Correct the repo init example" 2018-07-10 11:31:07 +00:00
Saul Wold c5f87b56c5 README.md/finishSetup: Correct the repo init example
Both the source URL format and default manifest (-m) were incorrect

Change-Id: I794279f5bad2ffdc586f09d5efa6d3d2d0c9dc10
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2018-07-09 17:09:26 -07:00
Erich Cordoba 4d99264354 Fix wrong link formation
There was a bug in the formation of the symlink that doesn't
create the correct folder structure.

Change-Id: I4d0215dc0f1c31588f337323a336c1ac4b70f651
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2018-07-09 17:13:38 -05:00
Erich Cordoba 6be7dd111b Add script o generate the cgcs-centos-repo folder and mock config file.
The build system needs the cgcs-centos-repo symlinks pointing to
the files in the mirror. Also, the mock.cfg.proto file is needed
to provide configurations to the mock environment.

With this script we eliminate the need of having a separate
repository just to hold these symlinks. Now, the developers can
recreate this folder whenever is needed.

Change-Id: Ic4ca21516a1e1271ed15666d5d46ce7f4f5b68b3
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2018-07-02 18:25:58 -05:00
Dean Troyer 2042bf7394 Clean up formatting to pass linters job and make it voting
Change-Id: I6e160137be0421880d5fb60b32098ecccc34c193
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-06-29 11:55:28 -05:00
Jesus Ornelas Aguayo de293fd429 Add cgcs-tis-repo generator
This commit adds the "generate-cgcs-tis-repo" which generates
the cgcs-tis-repo directory which includes the package dependencies
to build.

Change-Id: I08ca2ee8e3d853a9915fe29cbab4a0c1ea8d50b0
Signed-off-by: Jesus Ornelas Aguayo <jesus.ornelas.aguayo@intel.com>
2018-06-26 09:43:20 -04:00
Dean Troyer 62bd0253f0 Add build tools
This includes Docker containers to perform the StarlingX build
and a set of scripts to maintain a local mirror of binary CentOS
and other packages required to populate the final ISO file.

Change-Id: I8140fd8fa2d00e7aa98c895a8e4962ab3748669d
2018-06-08 17:01:43 -05:00