Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: containerize deployment #90

Merged
merged 19 commits into from
Jul 19, 2023
Merged

Conversation

epuertat
Copy link
Member

@epuertat epuertat commented Mar 27, 2023

Relevant Changes

  • Build and deploy with docker-compose.
  • Use make to wrap and launch docker-compose commands.
    • Targets follow the docker-compose commands: make build, make up, make logs, make down.
    • It dynamically sets multiple metadata like container LABELS (mimicking io.k8s.*):
      • io.ceph.compoment
      • io.ceph.summary
      • io.ceph.description
      • io.ceph.url
      • io.ceph.version
      • io.ceph.maintainer
      • io.ceph.git.repo
      • io.ceph.git.branch
      • io.ceph.git.commit
  • Use pdm as Python package manager to install packages, as it supports (the recently rejected) PEP-582 (installing dependencies to __pypackages__ instead of using virtualenv). Despite the PEP rejection, it still makes sense, since containerization renders virtualenv unnecessary.
  • Create 4 containers:
    • ceph/spdk (Dockerfile.spdk): an intermediate container resulting from building spdk RPM packages and installing those on top of a ubi9 base layer.
    • ceph/nvmeof (Dockerfile): the Python code consuming the SPDK JSON RPC API.
    • ceph/nvmeof-cli (Dockerfile): a containerized CLI tool to manage the nvmeof gateway.
    • ceph/vstart-cluster (Dockerfile.ceph): a vstart Ceph cluster based on the ceph/daemon image.
  • From 🧹Containerized CI tests #134 : nvmeof-cli reads input options from command-line arguments instead of ceph-nvmeof.conf file.
  • Removed dependencies from /usr/libexec since according to FHS this is meant for internal usage.
  • Add .dockerignore
  • Update spdk submodule settings, ignored when dirty
  • Move proto file to control/proto as it makes it easier to generate Python code

Tasks

  • Containerize and isolate spdk build (ubi8 and ubi9)
  • Containerize nvme-of build (ubi9 although 8 would be trivial)
  • Manage Python package dependencies and metadata (pdm)
  • Remove dependencies from /usr/libexec (since those are not intended for external usage).
  • Simplify build & deployment (docker-compose instead of make)
  • Containerize Ceph cluster
  • [Moved to spdk: no-hugepages #141]
  • Replace existing Makefile commands with pdm and docker-compose-based commands
  • Update documentation for developers and users
  • Update authors metadata in pyproject to include relevant contributors.
  • Pass ceph-nvmeof.conf as an external file rather than copied inside the container.
  • Devel containers:
    • Enable nvmeof-devel mounting the current dir inside the container $APPDIR.
    • Same for spdk, to allow binding it to a local build of librados and or librdb (.so? RPM?).
  • Replace Ceph container approach (ceph-daemon as base layer) with one installing RPMs from Shaman. This allows to specify a given Ceph version (17.2.6) or even a git hash, while the ceph-daemon container only allows for major release codenames (reef, quincy, etc.)
  • Update README with latest changes.
  • Bring Github CI from @baum's PR 🧹Containerized CI tests #134.

Instructions

See README.md in this PR.

@epuertat epuertat marked this pull request as draft March 27, 2023 17:51
@epuertat epuertat requested a review from sskaur March 27, 2023 17:51
@epuertat epuertat force-pushed the build-container branch 2 times, most recently from fe3b88b to ae98f58 Compare March 28, 2023 11:44
@epuertat epuertat changed the title chore: containerize deployment build: containerize deployment Mar 28, 2023
@epuertat epuertat marked this pull request as ready for review March 29, 2023 17:28
@epuertat epuertat force-pushed the build-container branch 4 times, most recently from e13268c to 0822af3 Compare April 4, 2023 20:06
@idryomov idryomov added this to the #2 milestone Apr 5, 2023
@epuertat epuertat force-pushed the build-container branch 5 times, most recently from 30bdab6 to 911ed96 Compare April 5, 2023 17:26
@epuertat epuertat force-pushed the build-container branch 2 times, most recently from 3ab53ee to 01bbe62 Compare April 10, 2023 09:51
@epuertat epuertat force-pushed the build-container branch 6 times, most recently from 5deba3f to 31a5c5e Compare April 20, 2023 16:53
@epuertat epuertat force-pushed the build-container branch from 31a5c5e to db85daa Compare May 8, 2023 07:45
docker-compose.yaml Outdated Show resolved Hide resolved
docker-compose.yaml Show resolved Hide resolved
- Return non-zero error code on client-server errors
- Add debug info to the CI job
- Fix & improve docs (SELinux config, typos)

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
epuertat added 5 commits July 4, 2023 13:26
Works-Around: https://tracker.ceph.com/issues/61882

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
kasserater referenced this pull request Jul 6, 2023
The discovery contrller implement the basic function.
Use command "python3 -m control.discovery" to start
discovery controller. Client can use command
"nvme discover -t tcp -a ip -s port" to get log pages.

The configuration is in ceph-nvmeof.conf [discovery] part.

feature: #108

Signed-off-by: Yin Congmin <congmin.yin@intel.com>
epuertat added 5 commits July 6, 2023 14:20
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
This changes reads .env from Makefile which allows to simplify make
configuration with host networking.

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Resolves: ceph#160

Other changes:
- Move mk/demo.mk constants to .env
- Decrease Hugepages to 2 GB

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
epuertat added 3 commits July 14, 2023 10:50
When a Python package needs to be updated in pyproject.toml, the Python
package manager PDM will check that against the lockfile (pdm.lock) and
if any changes are found it will fail. This ensure builds are
reproducible and consistent.

In order to update, remove or add new packages, the lockfile needs to be
updated. A new Makefile target (update-lockfile) has been added. It runs
on a new container image (nvmeof-builder) and only updates the pdm.lock
file:

```bash
make update-lockfile
git add pdm.lock
```

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Previously, docker-compose used fixed port mappings (host and container
ports matched, e.g: 4420:4420). However, that doesn't allow to deploy
multiple instances of the same container (--scale nvmeof=N).

Instead, ephemeral ports (randomly assigned by docker-compose) need to
be used. Fortunately, docker-compose provides with the 'port' command,
which maps container to host ports.

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Copy link
Member

@oritwas oritwas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation productization
Projects
Archived in project
7 participants