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

[DPE-3232] Apache ZooKeeper <> OCI Factory Integration #120

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions oci/zookeeper/.trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# CVEs in upstream

6 changes: 6 additions & 0 deletions oci/zookeeper/contacts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Who and how to notify about the build progress.
notify:
emails:
- data-platform@lists.launchpad.net
mattermost-channels:
- wxppdtg4obdg9csp9wxnqs1wqw # alerts on DataPlatform OCI channel
59 changes: 59 additions & 0 deletions oci/zookeeper/documentation.yaml
cjdcordeiro marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version: 1
application: zookeeper
is_chiselled: False
description: |
Current Apache ZooKeeper Docker Image from Canonical, based on Ubuntu.
Receives security updates and tracks the newest combination of Apache
ZooKeeper and Ubuntu. **This repository is free to use and exempted from
per-user rate limits.**

# About Apache ZooKeeper
ZooKeeper is a centralized service for maintaining configuration information,
naming, providing distributed synchronization, and providing group services.
All of these kinds of services are used in some form or another by
distributed applications. Read more on the Apache website. This image is
shipped in support of the Apache Kafka image.

Please note that the images tagged up to 3.1 are Dockerfile-base images,
whereas from version 3.8.2 onward the images are now ROCKs. As such the
entrypoint is now Pebble. Read more on the
[Rockcraft docs](https://canonical-rockcraft.readthedocs-hosted.com/en/latest/explanation/rocks/).

# --- USAGE INFORMATION ---
docker:
parameters:
- -p 2181:2181
access: Access your ZooKeeper server at `http://localhost:2181`.
parameters:
- type: -e
value: 'TZ=UTC'
description: Timezone.
- type: -p
value: '2181:2181'
description: Expose ZooKeeper server on `localhost:2181`.
- type: -v
value: "/path/to/config/file:/etc/zookeeper/zoo.cfg"
description: Local ZooKeeper configuration file.
- type: -v
value: "zookeeperData:/var/lib/zookeeper/data"
description: >
"Persist data in a docker volume named `zookeeperData`. "
"Make sure that the mount point is consistent with the configuration property `dataDir`.
- type: -v
value: "zookeeperLogData:/var/lib/zookeeper/data-log"
description: >
"Persist data in a docker volume named `zookeeperLogData`. "
"Make sure that the mount point is consistent with the configuration property `dataLogDir`.
debug:
text: |
### Debugging

To debug the container:
```bash
docker logs -f <zookeeper-container>
```

To get an interactive shell:
```bash
docker exec -it <zookeeper-container> /bin/bash
Copy link
Contributor Author

@deusebio deusebio Feb 29, 2024

Choose a reason for hiding this comment

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

@cjdcordeiro I tried to have this consistent with this, but the Rock syntax

docker exec -it <zookeeper-container> exec /bin/bash 

did not work for me. It provided this output:

CI runtime exec failed: exec failed: unable to start container process: exec: "exec": executable file not found in $PATH: unknown

I believe it is expected, but I'm not sure why it works for the other image.

What's your take on this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

hum weird. It works for me.

I took your rock from https://github.com/canonical/zookeeper-rock/actions/runs/8094163188,

then skopeo copy oci-archive:zookeeper_3.8.2_amd64.rock docker-daemon:test:latest and then

$ docker run --rm -it test exec /bin/bash
2024-02-29T15:14:03.595Z [pebble] Started daemon.
2024-02-29T15:14:03.601Z [pebble] POST /v1/exec 3.14273ms 202
2024-02-29T15:14:03.604Z [pebble] GET /v1/tasks/1/websocket/control 2.84456ms 200
2024-02-29T15:14:03.604Z [pebble] GET /v1/tasks/1/websocket/stdio 40.835µs 200
root@ae43a10f8a7c:~# 
root@ae43a10f8a7c:~# 
root@ae43a10f8a7c:~# whoami
root
root@ae43a10f8a7c:~# 

can you share your steps?

Copy link
Contributor Author

@deusebio deusebio Mar 1, 2024

Choose a reason for hiding this comment

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

yes, but that's not what is in the documentation I linked. If you do:

docker run --rm zookeeper:latest

you start the zookeeper process. But then imagine that you need to debug something that requires to login in the container. Then I first find the container id with docker ps, and use the container id in the command

docker exec -it <container-id> exec /bin/bash

This throws an error

OCI runtime exec failed: exec failed: unable to start container process: exec: "exec": executable file not found in $PATH: unknown

On the other hand, using the syntax

docker exec -it <container-id> /bin/bash

works just fine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh yeah, for sure. exec doesn't exist.

the latter docker exec -it <container-id> /bin/bash should always work just fine (unless you have a bare base). Doesn't matter if it is a rock or not.

that loki doc you linked is indeed weird. @lucabello can you please double check whether that command should work for you? maybe it's a typo

```
15 changes: 15 additions & 0 deletions oci/zookeeper/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 1

upload:
- source: "canonical/zookeeper-rock"
commit: 1781da1dacbacf647319731ff25ba4ad00082140
directory: .
release:
3.8.2-22.04:
end-of-life: "2024-05-01T00:00:00Z"
risks:
- edge
3:
end-of-life: "2024-05-01T00:00:00Z"
risks:
- edge
Loading