1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/bootstrap
Andrew Bartlett 4d63a1a79f bootstrap: Fix the spelling of README.md (again) and get a new GnuTLS
We re-run ./bootstrap/template.py --render to get a new GnuTLS on Fedora 32

This was missed with 7dc535995b
and so caused e0e51632cf to
break the sha1sum and so require 7077be01a3cc860ce1fcfafd9e5028829f0c1887
to fix it.

The sha1sum changes because we fixed the bug about the spelling of
README.md, which is helpful because otherwise we would not get a
new image.

This provides a GnuTLS 3.6.15 so that we still test using GnuTLS's
gnutls_aead_cipher_encryptv2() for the SMB encryption codepath.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14399

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-09-11 07:05:33 +00:00
..
generated-dists bootstrap: install perl-JSON on on rpm distributions 2020-09-07 12:02:15 +00:00
.gitlab-ci.yml bootstrap: add ubuntu2004 Ubuntu Focal Fossa (development branch) 2020-03-27 18:17:34 +00:00
config.py bootstrap: install perl-JSON on on rpm distributions 2020-09-07 12:02:15 +00:00
README.md bootstrap: document git push -o ci.variable='SAMBA_CI_REBUILD_IMAGES=yes' 2020-09-07 12:02:15 +00:00
sha1sum.txt bootstrap: Fix the spelling of README.md (again) and get a new GnuTLS 2020-09-11 07:05:33 +00:00
template.py bootstrap: Fix the spelling of README.md (again) and get a new GnuTLS 2020-09-11 07:05:33 +00:00

Samba Bootstrap

A pure python3 module with CLI to bootstrap Samba envs for multiple distributions.

Features

  • manage Samba dependencies list for multiple distributions
  • render dependencies package list to boostrap shell scripts(apt, yum and dnf)
  • render Vagrantfile to provision vitual machines with bootstrap scripts
  • render Dockerfile to build docker images with bootstrap scripts
  • build/tag/push docker images

Supported Distributions

deb: Debian 7|8|9|10, Ubuntu 1404|1604|1804 rpm: CentOS 6|7, Fedora 28|29, openSUSE Leap 15.0|15.1

Easy to add more.

Usage

Render files:

bootstrap/template.py --render

Files are rendered into bootstrap/generated-dists directory in current dir. It also generates bootstrap/sha1sum.txt and prints out the sha1sum of the current code/configuration.

Just calculate the sha1sum for consistency checks:

bootstrap/template.py --sha1sum

The checksum needs to be added as SAMBA_CI_CONTAINER_TAG in the toplevel .gitlab-ci.yml file.

User Stories

As a gitlab-ci user, I can use this tool to build new CI docker images:

After committing the result of calling bootstrap/template.py --render and updating SAMBA_CI_CONTAINER_TAG in .gitlab-ci.yml, you can push.

But you need to pass SAMBA_CI_REBUILD_IMAGES=yes as environment variable. It means the pipeline runs the 'images' stage and builds the new container images for all supported distributions and uploads the images into the registry.gitlab.com/samba-team/devel/samba container registry.

You can push by specifying the variable (note multiple -o options are allowed, see https://docs.gitlab.com/ee/user/project/push_options.html):

git push -o ci.variable='SAMBA_CI_REBUILD_IMAGES=yes' git@gitlab.com:samba-team/devel/samba.git ...

If you want to try to build images for the (currently) broken distributions, you would pass SAMBA_CI_REBUILD_BROKEN_IMAGES=yes in addition to the custom pipeline. Note the images for the broken distributions are just build, but not uploaded to the container registry. And any failures in the image creation is ignored. Once you managed to get success, you should move from .build_image_template_force_broken to .build_image_template. And also add a .samba-o3-template job for the new image in the main .gitlab-ci.yml file.

Over time we'll get a lot of images pushed to the container registry. The approach we're using allows gitlab project maintainers to remove old images! But it is possible to regenerate the images if you have the need to run a gitlab ci pipeline based on an older branch.

As a Samba developer/tester, I can setup a Samba env very quickly.

With Docker:

cd ~/samba git clean -xdf docker login docker pull registry.gitlab.com/samba-team/devel/samba/samba-ci-ubuntu1804:${sha1sum} docker run -it -v $(pwd):/home/samba/samba samba-ci-ubuntu1804:${sha1sum} bash

With podman:

podman run -ti --cap-add=SYS_PTRACE --security-opt seccomp=unconfined registry.gitlab.com/samba-team/devel/samba/samba-ci-ubuntu1804:${sha1sum} bash

With Vagrant:

cd bootstrap/generated-dists/ vagrant up # start all vagrant up debian9 # start one vagrant ssh debian9 vagrant destroy debian9 # destroy one vagrant destroy # destroy all

Or a remote/cloud machine:

scp bootstrap/generated-dists/fedora30/bootstrap.sh USER@IP: ssh USER@IP sudo bash ./bootstrap.sh