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

Add kafka producer to send task status messages #5405

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

kahowell
Copy link
Contributor

To try locally, you can use the oci-env kafka profile from pulp/oci_env#159.

Set up the oci-env to use the kafka profile:

COMPOSE_PROFILE=kafka

From a fresh oci-env pulp instance, try:

export REPO_NAME=$(head /dev/urandom | tr -dc a-z | head -c5)
export REMOTE_NAME=$(head /dev/urandom | tr -dc a-z | head -c5)
oci-env pulp file repository create --name $REPO_NAME
oci-env pulp file remote create --name $REMOTE_NAME \
    --url 'https://fixtures.pulpproject.org/file/PULP_MANIFEST'
oci-env pulp file repository sync --name $REPO_NAME --remote $REMOTE_NAME

Then inspect the kafka message that is produced via:

oci-env exec -s kafka \
  /opt/kafka/bin/kafka-console-consumer.sh \
  --bootstrap-server=localhost:9092 \
  --offset earliest \
  --partition 0 \
  --topic pulpcore.tasking.status \
  --max-messages 1

Closes #5337

@dkliban
Copy link
Member

dkliban commented Jul 16, 2024

@kahowell We would like to see this work move forward. This PR needs to be rebased. The documentation now lives in staging_docs directory.

In order for one of us to test this, it would be great if you could add a guide called "Integrate with Kafka" here: https://github.com/pulp/pulpcore/tree/main/staging_docs/admin/guides

This guide should provide instructions on how to configure Pulp and create some kind of consumer. I don't have any experience in this area, so I will defer to you on what should be included in the guide.

@lubosmj
Copy link
Member

lubosmj commented Jul 16, 2024

Actually, the runtime environment is provided in: https://github.com/pulp/oci_env/pull/159/files. Can we also copy these parts into the official pulpcore documentation?

@kahowell
Copy link
Contributor Author

@dkliban I rebased and moved the documentation as requested, and then retested to make sure things still work as intended. A quick note, likely unrelated to this PR: I had troubles this time getting my oci_env to play nice until I manually removed pulp_cli_deb from the environment and maybe some other dep things, I lost track 😄.

dkliban
dkliban previously approved these changes Jul 18, 2024
@daviddavis
Copy link
Contributor

There are some checks failing (e.g. this work needs a changelog entry in CHANGES/) but other than that, this LGTM.

To try locally, you can use the oci-env kafka profile from pulp/oci_env#159.

Set up the oci-env to use the kafka profile:

```
COMPOSE_PROFILE=kafka
```

From a fresh oci-env pulp instance, try:

```shell
export REPO_NAME=$(head /dev/urandom | tr -dc a-z | head -c5)
export REMOTE_NAME=$(head /dev/urandom | tr -dc a-z | head -c5)
oci-env pulp file repository create --name $REPO_NAME
oci-env pulp file remote create --name $REMOTE_NAME \
    --url 'https://fixtures.pulpproject.org/file/PULP_MANIFEST'
oci-env pulp file repository sync --name $REPO_NAME --remote $REMOTE_NAME
```

Then inspect the kafka message that is produced via:

```shell
oci-env exec -s kafka \
  /opt/kafka/bin/kafka-console-consumer.sh \
  --bootstrap-server=localhost:9092 \
  --offset earliest \
  --partition 0 \
  --topic pulpcore.tasking.status \
  --max-messages 1
```

Closes pulp#5337
@kahowell
Copy link
Contributor Author

c8bc087 to 44c53d3: fix lint issues, add CHANGES file.

@lubosmj lubosmj merged commit 1c9ca42 into pulp:main Jul 22, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export/Publish notifications
4 participants