Commit Graph

40 Commits

Author SHA1 Message Date
Ai Hamano 15125a46a1 Update RDO_REPO used to build CNI
Closes-Bug: #2054376
Change-Id: Ie92017f9be0b6c528fe1e1e8ce41b0c194553c16
2024-02-22 01:49:33 +00:00
Michał Dulko 042eaef61e Update RDO used to build CNI
Change-Id: I07b11d4d4ecb5a1a461edcb1e2ea2bc4ff5189c9
2023-09-21 11:02:42 +02:00
Michał Dulko bc65ed3c0c Run Kuryr inside containers in venv
We've just hit an issue where Ceph repo added by RDO upgraded setuptools
to a version that pip cannot uninstall. This is mainly because we're
still installing all the Kuryr dependencies in system's site-packages.
This commit switches us to create and use a virtualenv to have a clean
environment in which we install all the dependencies through pip.

Change-Id: Ieb9fd5ed0251425e9fe172e4a93ad048768ce785
2022-06-08 16:25:32 +02:00
Michał Dulko be428a5b4b Pin setuptools in CNI to 53.0.0-10.el9
Looks like RDO repos upgrade setuptools to version that creates a
problem when we attempt to upgrade it through pip. This commit pins
RPM setuptools to a version available in baseos repos.

This isn't really a great solution, we should probably just start
running in a virtualenv, but let's try to unblock the gates with this
thing.

Change-Id: I0b9e02ef1e9227497082a4a3cd803c52ad2789fb
2022-06-08 14:47:45 +02:00
Roman Dobosz f63cea5470 Switch to Centos Stream 9 for container images.
Change-Id: Ic3e96f0572baa0704688011deb60f705c2583d50
2022-05-25 13:32:38 +02:00
Roman Dobosz c624887103 Update Centos version for container images.
Due to the EOL for Centos 8, we need to go forward, and adopt to the
Stream version of Centos for container images of kuryr CNI and
controller.

There was applied modification for fixing (hopefully transient) issues
with variable usage in yum/dnf, so there is a need for replacing those
manually.

And finally, there was a switch from deprecated yum to dnf.

Change-Id: I19c16877e8ba6f401c9d76ed70b2380c4e3cfbe0
2022-02-02 15:56:47 +01:00
Sunday Mgbogu 06c6fa2b65 Update GO version
This commit updates the GO Version to 1.16

Change-Id: Ic83148d51bf2cc1b2a8c8e5bf8ba3c28e6fa588f
2021-05-07 14:15:35 +01:00
Daniel Mellado df36329238
Migrate kuryr-cni to go.mod
This commit migrates kuryr_cni to use go mod and updates its Dockerfile.

Closes-Bug: #1922235
Change-Id: If8b7c0350c0dcfd3de2735aff2efe9c86bbd4e58
2021-04-23 10:55:32 +02:00
Michał Dulko 217c6c4c00 CNI: Allow building with go 1.16
This forces the golang modules that we don't support to be off. It's
important to allow building kuryr-cni to be built with go 1.16 where
modules are on by default.

Change-Id: I058ab8d9e5e7df37efeee278ff4652de5f6861f3
2021-03-23 18:54:06 +01:00
Michał Dulko d528e81b6d Fix base docker images
Seems like quay.io/app-sre is no longer available to public and builds
fail. This commit fixes that by using registry.centos.org to get
centos:8 container image and our own quay.io/kuryr to host the
golang:1.15 image.

Change-Id: I044092e83b1a525ffd7692971a2e3313dfa1e421
2020-12-14 11:56:17 +01:00
Roman Dobosz a95c115e57 Use centos/golang from quay.io registry.
Change-Id: I517693dcd6dd3f99aa701b1a88bc6c003aa6569c
2020-12-03 13:20:15 +01:00
Michał Dulko f399418249 Update RDO to use Victoria release
Seems like we were still using Ussuri's RDO to get openvswitch package
and now that it broke it's an issue. This commit updates that to use
Victoria RDO release.

Change-Id: Ide317ac064dcc2a1a2e2bdbf8129bd9021f57a0d
2020-11-19 18:19:01 +01:00
Pratik Raj ef6219608d
optimize size and time using --no-cache-dir
Using --no-cache-dir flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Change-Id: I35b33ea50afce70b687762dba8b18f3f2be60e03
Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2020-10-03 11:50:54 +05:30
Michał Dulko 6d459143f6 Speed up container builds
Turns out upgrading pip enables grpcio PyPi package to use wheels to
install binaries, avioding need to compile it every time. This saves a
ton of time when building containers.

Change-Id: I6e4a5f9fddd24b8e88c62b444e8b305ade3f7f2a
2020-07-30 11:19:33 +02:00
Maysa Macedo 258c708b85 Fix CNI image built
Dependencies needed by openvswitch are not present on
the rdo-release-train-1 rpm. We need to update it
to make sure they're present.

Change-Id: I5050d7b7e49f2d0126c9daf449f20aa7d84331c6
2020-06-17 13:51:01 +02:00
Michał Dulko 139b912365 Upgrade centos in dockerfiles
Somehow an update to centos repos and the fact that docker.io centos
containers weren't updated for a while broke us. To fix this we need to
make sure RPMs in the container are upgraded, otherwise `yum history
undo last` fails miserably with missing packages errors.

Also this commit makes sure installation dies when we're unable to build
containers.

Change-Id: I29e19e13aa22047bfa07817a7794fc18612bbc32
2020-04-24 13:46:13 +02:00
Michał Dulko 1b48b76188 Add gcc-c++ into containers to fix grpcio build
Seems like grpcio 1.28.1 requires C++ compiler to build. This commit
fixes our build issues by adding one to the containers.

Change-Id: I8421d066160774431f72e38d36b32870f7f56b4c
2020-04-06 16:52:29 +02:00
ashish.billore 2e180457ef Make package repo configurable
Make package repo (default rdo master) as ARG so it becomes
configurable during docker build, needed for offline or specific
version build.

Change-Id: I001dc69ec51b893070895e0fbb37aab8640e6fe4
2020-03-04 15:15:50 +09:00
Gary Loughnane edc6597fe2 Add DPDK support for nested pods
Add DPDK support for nested K8s pods. Patch includes a new VIF driver on
the controller and a new CNI binding driver.

This patch introduces dependency from os-vif v.1.12.0, since there
a new vif type.

Change-Id: I6be9110192f524325e24fb97d905faff86d0cfef
Implements: blueprint nested-dpdk-support
Co-Authored-By: Kural Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Co-Authored-By: Marco Chiappero <marco.chiappero@intel.com>
Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
Signed-off-by: Danil Golov <d.golov@samsung.com>
2020-02-04 10:59:45 +03:00
Michał Dulko 28b27c5de2 Remove Python 2 support
Ussuri release is the one in which we drop Python 2 support, as its EOL
is pretty close now. This commit does so in kuryr-kubernetes by
removing Python 2 unit test jobs, switching all tempest jobs to Python
3, removing specific jobs for Python 3 and updating Dockerfiles to
centos:8 that includes Python 3 from the box.

Also CentOS 7 job is removed from check queue as it seems it doesn't
play well with Python 3. A CentOS 8 job will get created soon.

Change-Id: Id9983d2fd83cef89e3198b2760816cf4a851008b
2019-11-19 12:34:54 +01:00
pengyuesheng 663300ba91 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I16c4cc72870e1a2d495a2385b0cd21f8969ad474
2019-09-23 15:59:22 +08:00
Zuul 2caa1fb3af Merge "Add `yum/dnf clean all` to dockerfiles" 2019-07-01 08:44:12 +00:00
Michał Dulko e685d72800 Add `yum/dnf clean all` to dockerfiles
In a rather desperate try to shrink our container images this commit
adds `yum/dnf clean all` as part of the building process. This helps to
save around 100 MB in case of centos-based images.

Change-Id: I2aaadab4ffec6e0ad744e82fc9145cd86e14a224
2019-06-21 17:21:24 +02:00
Michał Dulko 245eb078f4 Implement kuryr-cni in golang
This commit reimplements the kuryr-cni, that is the actual CNI plugin
that gets called by kubelet and passes the request to kuryr-daemon, in
golang. This means that it can injected as a binary without any
dependencies, instead of using a bash script that looks for ID of
kuryr-daemon container and does `docker exec` to run Python kuryr-cni
inside. The obvious advantage of that is removing a constraint of
python, curl and docker/runc binaries being available on any K8s host
that runs Kuryr. This enables integration with Magnum, where kubelet
runs in such a minimal container. Besides that injecting a binary is way
more elegant and less error-prone.

The golang implementation should keep the compatibility with Python one.
Also currently only containerized jobs are switched to use it, so Python
implementation is still kept in the repo. I'm not against removing it in
very near future.

Please note that there is an important limitation in comparison to the
Python implementation - i.e. in case of golang binary running on K8s
host, we don't have an easy access to kuryr.conf, meaning that
localhost:50036 is currently hardcoded as the kuryr-daemon endpoint.
This should be fixed by putting the configured endpoint into
10-kuryr.conf file that gets injected onto the host by cni_ds_init
script.

Implements: blueprint golang-kuryr-cni
Change-Id: Ia241fb5b2937c63d3ed6e3de1ac3003e370e4db6
2019-06-17 12:58:37 +02:00
Michał Dulko ddfa9e6cca Update upper-constraints references in Dockerfile
We use git.openstack.org/cgit to fetch global upper-constraints.txt file
in our Dockerfiles. That is currently only a redirect and we should get
it switched to use opendev.org infra. This commit does so.

Change-Id: I32945c6b5426b6274c180a4a90dad09c414977b2
2019-06-05 17:21:57 +02:00
Ilya Maximets 685f4c456a Add PodResources service client
PodResources client could be used by sriov cni to obtain devices
allocated for container by sriov device-plugin.

KubeletPodResources service is still in alpha, so it should be
explicitly enabled in kubelet feature-gates:
    kubelet --feature-gates KubeletPodResources=true

New config option 'kubelet_root_dir' added to 'sriov' section
that defaults to kubelet default root-dir '/var/lib/kulelet'.
In case kubelet started with non-default root directory passed
via '--root-dir' option, the same value should be configured
in 'kubelet_root_dir'.
Note that if sriov binding driver will be used inside container
'kubelet_root_dir'/pod-resources directory should be mounted
to this container in order to allow communication with kubelet
via gRPC protocol over the unix domain socket.

Partial-Bug: 1826865
Depends-On: https://review.openstack.org/#/c/652629
Change-Id: Icf088b839db079efe9c7647c31be4ead867ed32b
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
2019-05-20 14:16:04 +03:00
Michał Dulko 8b76509514 Clean up Dockerfiles and how we build them
This commit does several cleanups to the Dockerfiles that we have:

* git is removed from the images after Kuryr packages installation
* jq and wget is removed from kuryr-cni image as those ar no longer used
* explicit setuptools installation is no longer required
* raw Kuryr code is removed from images after it's `pip install`ed
* unnecessary VOLUME line is removed from kuryr-cni Dockerfile
* CNI_CONFIG_DIR and CNI_BIN_DIR build arguments are removed from
  kuryr-cni Dockerfile as they are not used anywhere. Initially we've
  kept them to allow deployer to tell where host's /etc/cni/net.d and
  /opt/cni/bin will be mounted, but one of the refactorings of
  cni_ds_init must have stopped depending on them and we simply started
  to expect the mounts to be in the same paths as on host. We can
  continue to do that.

The build_cni_daemonset_image script was created back in the time when
we have had multi-stage build of the kuryr-cni image. This is no longer
the case and building the image is as easy as:

    `docker build -f cni.Dockerfile .`

Given that this commit removes the script and updates documentation to
recommend using `docker build` directly.

Change-Id: Ib1807344ede11ec6845e5f09c5a87c29a779af03
2018-12-17 10:40:50 +01:00
Daniel Mellado 7e52b9ef3f Fix container image creation.
This commit fixes the container creation due to centos shipping an older
version of setuptools. [1]

[1] https://github.com/openaps/openaps/issues/95

Closes-Bug: 1778048
Change-Id: Ifbce25a5a49cbc3df58850b10819843e640c8f26
2018-06-21 13:59:22 +02:00
Zuul 711f61c581 Merge "Modify maintainers of Dockerfiles" 2018-04-17 08:52:48 +00:00
Daniel Mellado 2ed3923a0a Apply UC to Dockerfiles
Upper constraints weren't applied to the Dockerfiles installation so
pip install deps when over it. This commit fixes it by defining a new
env var for it and passit it to pip.

Closes-Bug: #1763752
Change-Id: Id126fee033db6f150ad95c94682eb56b4b2cea03
2018-04-13 17:24:25 +02:00
Michał Dulko ca3bbd432b Modify maintainers of Dockerfiles
Vicas is no longer working on our Dockerfiles, so let's put there me
instead.

Change-Id: I0fcac794fb037fa11160adab1832026d09aafa1f
2018-04-13 14:06:06 +02:00
Michał Dulko 206c158d37 Execute kuryr-cni as `docker exec`
This commit changes the way kuryr-cni is executed in containerized
deployments. Now it'll use `docker exec` command to execute kuryr-cni
inside the CNI container. This should make it easier to be consumed by
deployers.

To be able to do such changes I needed to stop mounting host's /etc
directory. I believe this was unnecessary and was blocking curl from
working in isolation from host OS.

Closes-Bug: 1757531

Change-Id: I373d65536a43eab98f0fc708936b97637f82eaff
2018-04-10 15:01:09 +02:00
Zuul 563ddbee3b Merge "Deprecate running kuryr-k8s without kuryr-daemon" 2018-03-16 10:58:39 +00:00
Michał Dulko 898abb4a75 Deprecate running kuryr-k8s without kuryr-daemon
This commit implements what was discussed on the PTG, i.e. deprecation
of running Kuryr-Kubernetes without kuryr-daemon services. This commit
includes changes in configuration defaults, sample local.conf files,
documentation, gates and a release note explaining the change.

Change-Id: I152c81797cb83237af4917a4487cb1f1918270aa
2018-03-14 15:44:16 +01:00
Michał Dulko fce174b7f9 Create lockfiles directory in CNI Dockerfile
This commit adds creating a directory for lockfiles in the CNI Docker
image. As in oslo.concurrency `lock_path` option defaults to
`OSLO_LOCK_PATH` environment variable, this variable is also set to
point to that directory.

Change-Id: Ia69c75c34a8da4281414395805f4927de1e91a39
Closes-Bug: 1754636
2018-03-09 12:56:33 +01:00
Michał Dulko 78102c9984 Use virtualenv to build kuryr-cni Docker image
This commit changes the way we produce kuryr-cni Docker image. Previously we've
distributed the kuryr-driver as pyinstaller binary that contained Python 3
interpreter and all the dependencies. This binary was called from CNI. That
approach had some disadvantages, the major being complicated build procedure
and having to see false-positive BrokenPipeError tracebacks in kubelet
logs.

This commit implements distributing kuryr-driver as a virtualenv with
kuryr-kubernetes and all the dependecies installed. That virtualenv is then
copied onto the host system and CNI can easily activate it and run kuryr-cni
binary. This should solve issues caused by pyinstaller.

Closes-Bug: 1747058

Change-Id: I65b01ba27cbe39b66f0a972d12f3abc166934e62
2018-02-02 19:55:44 +01:00
Michał Dulko 18db649943 Support kuryr-daemon when running containerized
This commit implements kuryr-daemon support when
KURYR_K8S_CONTAINERIZED_DEPLOYMENT=True. It's done by:

* CNI docker image installs Kuryr-Kubernetes pip package and adds
  exectution of kuryr-daemon into entrypoint script.
* Hosts /proc and /var/run/openvswitch are mounted into the CNI
  container.
* Code is changed to use /host_proc instead of /proc when in a container
  (it's impossible to mount host's /proc into container's /proc).

Implements: blueprint cni-split-exec-daemon

Change-Id: I9155a2cba28f578cee129a4c40066209f7ab543d
2017-12-13 11:45:22 +01:00
Michał Dulko eb428c1170 Clean up ENV vars mistmatches in Dockerfiles
Containerized deployment through DevStack had two bugs related to
mismatches in handling environment variables in Dockerfiles:

1. cni.Dockerfile was using ENV vars to define CNI bin and conf
directories, but when DevStack was building them it wasn't setting them
correctly. This resulted in CNI binaries and configs ending up
in wrong directories when deploying through DevStack. This is fixed by
passing $CNI_BIN_DIR and $CNI_CONF_DIR into the build function.
2. cni_builder script used $CNI_BIN_DIR_PATH, but it was only defined in
cni.Dockerfile and was is missing from cni_builder.Dockerfile. This
resulted in malformed kuryr-cni script, that pointed to non-existing
"/kuryr-cni-bin" file. This is fixed by adding those ENV vars to
cni_builder.Dockerfile

Change-Id: I4833124231f256b74f80bd5fee732686bffab77e
Closes-Bug: 1718137
2017-09-20 10:35:36 +02:00
Antoni Segura Puimedon 460cab6a99 CNI container: parametrize and clean up
Make the CNI config and binary locations parametrized so it is suitable
for more kinds of deployment.

Implements: blueprint kubeadminstallable
Change-Id: I01c7540641fe120faec902008ebd842339b50384
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
Co-Authored-By: Michał Dulko <mdulko@redhat.com>
2017-09-14 13:33:53 +02:00
vikaschoudhary16 632d32be89 Add support to install Kuryr as a network addon
Implements blueprint kubeadminstallable

Change-Id: I38cbc88ee7ee7b544ec15ee8f6ef9e0a0f474c2a
Co-Authored-By: Antoni Segura Puimedon <antonisp@celebdor.com>
Co-Authored-By: Michal Dulko <mdulko@redhat.com>
2017-09-14 13:33:53 +02:00