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

docs: add howto guides for switching from the charm plugin #1967

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lengau
Copy link
Collaborator

@lengau lengau commented Oct 17, 2024

This adds howto guides to switch from the charm plugin to the python and poetry plugins.

@lengau lengau requested review from medubelko and a team October 17, 2024 20:25
@lengau lengau linked an issue Oct 17, 2024 that may be closed by this pull request
This adds howto guides to switch from the charm plugin to the python
and poetry plugins.
Copy link
Contributor

@mattculler mattculler left a comment

Choose a reason for hiding this comment

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

Very clear!

@jnsgruk
Copy link
Member

jnsgruk commented Oct 18, 2024

Gave this a go here: jnsgruk/zinc-k8s-operator#288

Might be worth including a section about using override-pull as a place where people can generate requirements'txt if they need to.

I guess they could also use override-build and just place their generation code before craftctl default.

Edit: lots of failed integration tests when I changed to this; will investigate.

@jnsgruk
Copy link
Member

jnsgruk commented Oct 18, 2024

Heh. The python plugin doesn't seem to have included any dispatch file...

ubuntu@ubuntu-noble-2e39:~/zinc_charm_unzipped$ ls -la
total 39480
drwxrwxr-x 5 ubuntu ubuntu     4096 Oct 18 10:30 .
drwxr-xr-x 9 ubuntu ubuntu     4096 Oct 18 10:30 ..
drwxrwxr-x 2 ubuntu ubuntu     4096 Oct 18 10:30 bin
drwxrwxr-x 3 ubuntu ubuntu     4096 Oct 18 10:30 lib
drwxrwxr-x 3 ubuntu ubuntu     4096 Oct 18 10:30 lib64
-rw-r--r-- 1 ubuntu ubuntu      255 Oct 18 10:21 manifest.yaml
-rw-r--r-- 1 ubuntu ubuntu     1402 Oct 18 10:21 metadata.yaml
-rw-r--r-- 1 ubuntu ubuntu      169 Oct 18 10:21 pyvenv.cfg

Edit: switched to the latest/edge channel and things seem better:

ubuntu@ubuntu-noble-2e39:~/data/code/charms/zinc-k8s-operator$ unzip -l ./zinc-k8s_amd64.charm | grep -v python3
Archive:  ./zinc-k8s_amd64.charm
  Length      Date    Time    Name
---------  ---------- -----   ----
      272  2024-10-18 10:38   manifest.yaml
     1402  2024-10-18 10:38   metadata.yaml
      673  2024-10-18 10:38   dispatch
      188  2024-10-18 10:34   venv/pyvenv.cfg
     2680  2024-10-03 08:44   src/zinc.py
     3922  2024-10-03 08:44   src/charm.py
        0  2022-05-31 14:57   src/prometheus_alert_rules/.gitkeep
      294  2022-07-30 20:33   src/prometheus_alert_rules/zinc_missing.rule
        0  2022-05-31 14:57   src/loki_alert_rules/.gitkeep
    20957  2023-08-23 13:19   src/grafana_dashboards/zinc.json.tmpl
    99854  2024-08-19 14:12   lib/charms/loki_k8s/v0/loki_push_api.py
    30560  2024-08-28 16:53   lib/charms/traefik_k8s/v2/ingress.py
    96662  2024-08-19 14:12   lib/charms/prometheus_k8s/v0/prometheus_scrape.py
    34280  2024-10-02 08:52   lib/charms/parca/v0/parca_scrape.py
    80536  2024-08-19 14:12   lib/charms/grafana_k8s/v0/grafana_dashboard.py
     9975  2024-10-02 08:52   lib/charms/observability_libs/v0/juju_topology.py
---------                     -------
 41499875                     2412 files

Alas, no dice on deploying, though...

ubuntu@ubuntu-noble-2e39:~/zinc_charm/venv$ juju debug-log
unit-zinc-k8s-0: 10:39:59 WARNING unit.zinc-k8s/0.install ln: failed to create symbolic link '/var/lib/juju/agents/unit-zinc-k8s-0/charm/venv/bin/python': No such file or directory
unit-zinc-k8s-0: 10:39:59 WARNING unit.zinc-k8s/0.install /var/lib/juju/agents/unit-zinc-k8s-0/charm/dispatch: 16: exec: /var/lib/juju/agents/unit-zinc-k8s-0/charm/venv/bin/python: not found
unit-zinc-k8s-0: 10:39:59 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 127

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.

Document the python and poetry plugins
3 participants