Merge ~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration into launchpad-mojo-specs:master

Proposed by Simone Pelosi
Status: Superseded
Proposed branch: ~pelpsi/launchpad-mojo-specs/+git/private:fetch-service-charmhub-configuration
Merge into: launchpad-mojo-specs:master
Diff against target: 157 lines (+81/-0)
12 files modified
lp-fetch-service/README.md (+21/-0)
lp-fetch-service/bundle.yaml (+26/-0)
lp-fetch-service/configs/custom-secgroups-staging.yaml (+9/-0)
lp-fetch-service/manifest (+1/-0)
lp-fetch-service/manifest-perform-autodeploy (+1/-0)
lp-fetch-service/manifest-verify (+1/-0)
lp-fetch-service/manifests/deploy (+5/-0)
lp-fetch-service/manifests/secgroups (+1/-0)
lp-fetch-service/manifests/verify (+4/-0)
lp-fetch-service/predeploy (+3/-0)
lp-fetch-service/utils (+1/-0)
lp-fetch-service/verify (+8/-0)
Reviewer Review Type Date Requested Status
Canonical Launchpad Engineering Pending
Review via email: mp+464813@code.launchpad.net

This proposal supersedes a proposal from 2024-04-23.

This proposal has been superseded by a proposal from 2024-04-23.

Commit message

Get fetch-service from Charmhub

To post a comment you must log in.

Unmerged commits

5c7c771... by Simone Pelosi

Get fetch-service from Charmhub

d64b385... by Ines Almeida

lp-fetch-service: fix small typo in mojo spec

ca5f298... by Ines Almeida

lp-fetch-service: add exposed parameter to fetch-service charm

This parameter makes an application publicly available over the network.

aa8818e... by Ines Almeida

lp-fetch-service: add num_units to bundle

7ff39a1... by Ines Almeida

lp-fetch-service: set to deploy to qastaging instead of staging (plus minor MOJO_SPEC path update)

07db796... by Ines Almeida

lp-fetch-service: Add barebones of lp-fetch-service mojo spec

While the charm and snap are not public, they require manually building, and deploying from the local charm

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lp-fetch-service/README.md b/lp-fetch-service/README.md
2new file mode 100644
3index 0000000..1ad35cd
4--- /dev/null
5+++ b/lp-fetch-service/README.md
6@@ -0,0 +1,21 @@
7+# Launchpad fetch service
8+
9+This spec deploys Launchpad's fetch service.
10+
11+You can run it locally using Juju's LXD support and Mojo. First, configure
12+your environment:
13+
14+ export MOJO_ROOT="$HOME/.local/share/mojo"
15+ export MOJO_PROJECT=mojo-lp-fetch-service
16+ export MOJO_WORKSPACE=devel
17+ export MOJO_SERIES=jammy
18+ export MOJO_SPEC="$HOME/spec"
19+ export MOJO_STAGE=lp-fetch-service/devel
20+
21+Then run the spec using Mojo:
22+
23+ mojo project-new -c containerless
24+ mojo workspace-new
25+ mojo run
26+
27+You must have python3-yaml installed.
28diff --git a/lp-fetch-service/bundle.yaml b/lp-fetch-service/bundle.yaml
29new file mode 100644
30index 0000000..67472ee
31--- /dev/null
32+++ b/lp-fetch-service/bundle.yaml
33@@ -0,0 +1,26 @@
34+{%- if stage_name == "production" %}
35+{%- set devel = False %}
36+{%- elif stage_name == "qastaging" %}
37+{%- set devel = False %}
38+{%- else %}
39+{%- set devel = True %}
40+{%- endif -%}
41+
42+series: jammy
43+applications:
44+{%- if devel or stage_name == "qastaging" %}
45+ fetch-service:
46+ {#- While the fetch-service charm and snap are not public, we are deploying
47+ a locally built charm. The lines below should be replaced with the path
48+ to charmhub, channel and revision number once the charm and snap are
49+ public. Currently, this expects the charm and snap to be copied to the
50+ path where the bundle.yaml is rendered, in the mojo project folder (eg.
51+ .../mojo/lp-fetch-service/jammy/devel/charms/lp-fetch-service/). #}
52+ charm: ch:fetch-service
53+ channel: edge
54+ revision: 4
55+ num_units: 1
56+ expose: true
57+ options:
58+ channel: "latest/edge"
59+{%- endif %}
60diff --git a/lp-fetch-service/configs/custom-secgroups-staging.yaml b/lp-fetch-service/configs/custom-secgroups-staging.yaml
61new file mode 100644
62index 0000000..78f1546
63--- /dev/null
64+++ b/lp-fetch-service/configs/custom-secgroups-staging.yaml
65@@ -0,0 +1,9 @@
66+applications:
67+ fetch-service:
68+ type: neutron
69+ rules:
70+ - rsync-logs
71+rules:
72+ rsync-logs:
73+ # Allow launchpad-bastion-ps5 to fetch logs.
74+ - {"protocol": "tcp", "family": "IPv4", "port": 873, "cidr": "10.131.10.100/32"}
75diff --git a/lp-fetch-service/manifest b/lp-fetch-service/manifest
76new file mode 120000
77index 0000000..e1c38b1
78--- /dev/null
79+++ b/lp-fetch-service/manifest
80@@ -0,0 +1 @@
81+manifests/deploy
82\ No newline at end of file
83diff --git a/lp-fetch-service/manifest-perform-autodeploy b/lp-fetch-service/manifest-perform-autodeploy
84new file mode 120000
85index 0000000..e1c38b1
86--- /dev/null
87+++ b/lp-fetch-service/manifest-perform-autodeploy
88@@ -0,0 +1 @@
89+manifests/deploy
90\ No newline at end of file
91diff --git a/lp-fetch-service/manifest-verify b/lp-fetch-service/manifest-verify
92new file mode 120000
93index 0000000..6e02de4
94--- /dev/null
95+++ b/lp-fetch-service/manifest-verify
96@@ -0,0 +1 @@
97+manifests/verify
98\ No newline at end of file
99diff --git a/lp-fetch-service/manifests/deploy b/lp-fetch-service/manifests/deploy
100new file mode 100644
101index 0000000..2d52196
102--- /dev/null
103+++ b/lp-fetch-service/manifests/deploy
104@@ -0,0 +1,5 @@
105+script config=predeploy
106+bundle config=bundle.yaml max-wait=900 local=deploy-secrets
107+juju-check-wait
108+include config=manifests/secgroups
109+include config=manifests/verify
110diff --git a/lp-fetch-service/manifests/secgroups b/lp-fetch-service/manifests/secgroups
111new file mode 100644
112index 0000000..8c438ee
113--- /dev/null
114+++ b/lp-fetch-service/manifests/secgroups
115@@ -0,0 +1 @@
116+script config=utils/custom-secgroups.py SKIP_STAGES=devel
117diff --git a/lp-fetch-service/manifests/verify b/lp-fetch-service/manifests/verify
118new file mode 100644
119index 0000000..f25f902
120--- /dev/null
121+++ b/lp-fetch-service/manifests/verify
122@@ -0,0 +1,4 @@
123+juju-check-wait
124+# It occasionally takes a little while for all the servers to start
125+# accepting connections.
126+verify retry=3
127diff --git a/lp-fetch-service/predeploy b/lp-fetch-service/predeploy
128new file mode 100755
129index 0000000..e6e2fbc
130--- /dev/null
131+++ b/lp-fetch-service/predeploy
132@@ -0,0 +1,3 @@
133+#! /bin/sh
134+set -e
135+exit 0
136diff --git a/lp-fetch-service/utils b/lp-fetch-service/utils
137new file mode 120000
138index 0000000..468ba70
139--- /dev/null
140+++ b/lp-fetch-service/utils
141@@ -0,0 +1 @@
142+../utils
143\ No newline at end of file
144diff --git a/lp-fetch-service/verify b/lp-fetch-service/verify
145new file mode 100755
146index 0000000..df9e6ef
147--- /dev/null
148+++ b/lp-fetch-service/verify
149@@ -0,0 +1,8 @@
150+#! /bin/sh
151+set -e
152+
153+TOP="${0%/*}"
154+
155+export EXTRA_SKIP_CHECKS="check_swap${EXTRA_SKIP_CHECKS:+|${EXTRA_SKIP_CHECKS}}"
156+
157+exec "$TOP/utils/verify"

Subscribers

People subscribed via source and target branches