Merge ~vultaire/charm-kubernetes-service-checks:remove-charmcraft-python-dep into charm-kubernetes-service-checks:master

Proposed by Paul Goins
Status: Rejected
Rejected by: Haw Loeung
Proposed branch: ~vultaire/charm-kubernetes-service-checks:remove-charmcraft-python-dep
Merge into: charm-kubernetes-service-checks:master
Diff against target: 136 lines (+30/-19)
8 files modified
.gitignore (+1/-0)
.jujuignore (+3/-0)
Makefile (+13/-15)
charmcraft.yaml (+6/-0)
dev/null (+0/-3)
tests/functional/tests/bundles/overlays/bionic.yaml.j2 (+3/-0)
tests/functional/tests/bundles/overlays/focal.yaml.j2 (+3/-0)
tox.ini (+1/-1)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-bootstack (community) continuous-integration Approve
Paul Goins Approve
BootStack Reviewers mr tracking; do not claim Pending
BootStack Reviewers Pending
Review via email: mp+406246@code.launchpad.net

Commit message

Update for more recent charmcraft

Changes include:
* Remove dependency on charmcraft Python lib in preference of the snap
* Update Makefile to work with charmcraft 1.1.0 builds.

The "fixes" here are intended as a bridge until this charm is migrated
to CharmHub, after which we may want to leverage the new build features
allowing for building targeted charms with different
channels/architectures via charmcraft.yaml.

To post a comment you must log in.
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paul Goins (vultaire) wrote :

After reviewing charmcraft.yaml (a new config file used by the charmcraft snap), I think this set of patches was the wrong way to go about things.

"charmcraft build" can generate multiple charms now. And I'm not sure how this works together with the charm store, or if it forces moving to charmhub. This needs deeper review.

review: Needs Fixing
Revision history for this message
Paul Goins (vultaire) wrote :

This may be an OK "mid-term" solution which builds toward the long-term solution of porting this charm over to CharmHub. While the build artifact here is indeed built with some platform-specific bits, they all have fallbacks to pure-Python versions, and so we can effectively use these changes together with the newer charmcraft to continue our current flow.

Thus, I'm reverting my Needs Fixing, and adding an extra reviewer slot.

review: Approve
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
3e899b1... by Paul Goins

Update for CharmHub and recent charmcraft

* Replace charmcraft Python dependency with charmcraft snap

* Added per-series builds

* Added .jujuignore per "charmcraft init" to avoid including certain
  files during the build process

* Updated .gitignore to ignore *.charm files

* Updated Makefile appropriately

* Updated functional tests to use the per-arch charms

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
Paul Goins (vultaire) wrote :

I've been doing some rework here; this isn't quite ready yet. The functional tests need to be updated to use the new per-arch builds.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
Peter Sabaini (peter-sabaini) wrote :

Hey Paul, based on your last comment I'm setting this to WIP, hope thats ok -- naturally feel free to set it back!

Revision history for this message
Paul Goins (vultaire) wrote :

No; that's totally OK!

And it seems there's not much of a hurry here, either. We're effectively blocked from pushing direct to CharmHub for now; legacy charms are copied over read-only for now. This will eventually change though. (See this thread: https://discourse.charmhub.io/t/charmhub-groups-support/4913)

Revision history for this message
Paul Goins (vultaire) wrote :

Adding context to ensure intent is clear: as we can't (yet) upload directly to CharmHub, we can't yet leverage the multiple per-target charm builds generated by the charmcraft tool.

Unmerged commits

3e899b1... by Paul Goins

Update for CharmHub and recent charmcraft

* Replace charmcraft Python dependency with charmcraft snap

* Added per-series builds

* Added .jujuignore per "charmcraft init" to avoid including certain
  files during the build process

* Updated .gitignore to ignore *.charm files

* Updated Makefile appropriately

* Updated functional tests to use the per-arch charms

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 5237a11..5581913 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -40,3 +40,4 @@ dist/
6 # Builds
7 .build/
8 build/
9+/*.charm
10diff --git a/.jujuignore b/.jujuignore
11new file mode 100644
12index 0000000..6ccd559
13--- /dev/null
14+++ b/.jujuignore
15@@ -0,0 +1,3 @@
16+/venv
17+*.py[cod]
18+*.charm
19diff --git a/Makefile b/Makefile
20index cb7ac8b..be3c2f4 100644
21--- a/Makefile
22+++ b/Makefile
23@@ -1,4 +1,5 @@
24 PYTHON := /usr/bin/python3
25+TEMPDIR := /var/tmp
26
27 PROJECTPATH=$(dir $(realpath $(MAKEFILE_LIST)))
28 ifndef CHARM_BUILD_DIR
29@@ -28,7 +29,7 @@ clean:
30 @echo "Cleaning files"
31 @git clean -ffXd -e '!.idea'
32 @echo "Cleaning existing build"
33- @rm -rf ${CHARM_BUILD_DIR}/${CHARM_NAME}
34+ @rm -f ${CHARM_BUILD_DIR}/${CHARM_NAME}*.charm
35
36 submodules:
37 @echo "Cloning submodules"
38@@ -39,27 +40,24 @@ submodules-update:
39 @git submodule update --init --recursive --remote --merge
40
41 build:
42- @echo "Building charm to base directory ${CHARM_BUILD_DIR}/${CHARM_NAME}"
43+ @echo "Building charm into ${CHARM_BUILD_DIR}..."
44 @-git rev-parse --abbrev-ref HEAD > ./repo-info
45 @-git describe --always > ./version
46 @mkdir -p ${CHARM_BUILD_DIR}
47 @tox -e build
48- @mv ${CHARM_NAME}.charm ${CHARM_BUILD_DIR}
49+ @cp -v $$(ls -1rt ${CHARM_NAME}_*.charm | tail -n1) ${TEMPDIR}/${CHARM_NAME}_proof.charm
50+ @mv -v ${CHARM_NAME}_*.charm ${CHARM_BUILD_DIR}
51
52
53-release: clean build unpack
54- @echo "Charm is built at ${CHARM_BUILD_DIR}/${CHARM_NAME}"
55+release: clean build
56+ @echo; echo "Charm is built at the following locations:"
57+ @bash -c 'ls -1 "${CHARM_BUILD_DIR}/"${CHARM_NAME}_*.charm'
58
59 unpack: build
60- @-rm -rf ${CHARM_BUILD_DIR}/${CHARM_NAME}
61- @mkdir -p ${CHARM_BUILD_DIR}/${CHARM_NAME}
62- @echo "Unpacking built .charm into ${CHARM_BUILD_DIR}/${CHARM_NAME}"
63- @cd ${CHARM_BUILD_DIR}/${CHARM_NAME} && unzip -q ${CHARM_BUILD_DIR}/${CHARM_NAME}.charm
64- # until charmcraft copies READMEs in, we need to publish charms with readmes in them.
65- @cp ${PROJECTPATH}/README.md ${CHARM_BUILD_DIR}/${CHARM_NAME}
66- @cp ${PROJECTPATH}/copyright ${CHARM_BUILD_DIR}/${CHARM_NAME}
67- @cp ${PROJECTPATH}/repo-info ${CHARM_BUILD_DIR}/${CHARM_NAME}
68- @cp ${PROJECTPATH}/version ${CHARM_BUILD_DIR}/${CHARM_NAME}
69+ @-rm -rf ${TEMPDIR}/${CHARM_NAME}
70+ @mkdir -p ${TEMPDIR}/${CHARM_NAME}
71+ @echo "Unpacking built .charm into ${TEMPDIR}/${CHARM_NAME}"
72+ @cd ${TEMPDIR}/${CHARM_NAME} && unzip -q ${TEMPDIR}/${CHARM_NAME}_proof.charm
73
74 lint:
75 @echo "Running lint checks"
76@@ -71,7 +69,7 @@ black:
77
78 proof: unpack
79 @echo "Running charm proof"
80- @charm proof ${CHARM_BUILD_DIR}/${CHARM_NAME}
81+ @charm proof ${TEMPDIR}/${CHARM_NAME}
82
83 unittests:
84 @echo "Running unit tests"
85diff --git a/charmcraft.yaml b/charmcraft.yaml
86new file mode 100644
87index 0000000..d8e00a9
88--- /dev/null
89+++ b/charmcraft.yaml
90@@ -0,0 +1,6 @@
91+type: "charm"
92+bases:
93+ - name: "ubuntu"
94+ channel: "18.04"
95+ - name: "ubuntu"
96+ channel: "20.04"
97diff --git a/tests/functional/tests/bundles/overlays/bionic.yaml.j2 b/tests/functional/tests/bundles/overlays/bionic.yaml.j2
98index 65b2826..9a8a77d 100644
99--- a/tests/functional/tests/bundles/overlays/bionic.yaml.j2
100+++ b/tests/functional/tests/bundles/overlays/bionic.yaml.j2
101@@ -1 +1,4 @@
102 series: bionic
103+applications:
104+ {{ charm_name }}:
105+ charm: {{ CHARM_BUILD_DIR }}/{{ charm_name }}_ubuntu-18.04-amd64.charm
106diff --git a/tests/functional/tests/bundles/overlays/focal.yaml.j2 b/tests/functional/tests/bundles/overlays/focal.yaml.j2
107index d3f46ab..2355df1 100644
108--- a/tests/functional/tests/bundles/overlays/focal.yaml.j2
109+++ b/tests/functional/tests/bundles/overlays/focal.yaml.j2
110@@ -1 +1,4 @@
111 series: focal
112+applications:
113+ {{ charm_name }}:
114+ charm: {{ CHARM_BUILD_DIR }}/{{ charm_name }}_ubuntu-20.04-amd64.charm
115diff --git a/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
116deleted file mode 100644
117index 7f59ee2..0000000
118--- a/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
119+++ /dev/null
120@@ -1,3 +0,0 @@
121-applications:
122- {{ charm_name }}:
123- charm: {{ CHARM_BUILD_DIR }}/{{ charm_name }}.charm
124diff --git a/tox.ini b/tox.ini
125index a435b08..89d4442 100644
126--- a/tox.ini
127+++ b/tox.ini
128@@ -33,7 +33,7 @@ passenv =
129 OS_IDENTITY_API_VERSION
130
131 [testenv:build]
132-deps = charmcraft<1.1.0
133+whitelist_externals = /snap/bin/charmcraft
134 commands = charmcraft build
135
136 [testenv:lint]

Subscribers

People subscribed via source and target branches

to all changes: