Skip to content

Commit 6f9a1e5

Browse files
committed
Add the plugin api
1 parent 0e67280 commit 6f9a1e5

File tree

21 files changed

+962
-1
lines changed

21 files changed

+962
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
- signet_test.py
5252
- scenarios_test.py
5353
- namespace_admin_test.py
54+
- simln_test.py
5455
steps:
5556
- uses: actions/checkout@v4
5657
- uses: azure/[email protected]

resources/plugins/__init__.py

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v2
2+
name: simln
3+
description: A Helm chart to deploy simln
4+
version: 0.1.0
5+
appVersion: "0.1.0"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"nodes": [
3+
{
4+
"id": "tank-0000-ln",
5+
"address": "https://tank-0004-ln:10009",
6+
"macaroon": "/working/admin.macaroon",
7+
"cert": "/working/tls.cert"
8+
},
9+
{
10+
"id": "tank-0001-ln",
11+
"address": "https://tank-0005-ln:10009",
12+
"macaroon": "/working/admin.macaroon",
13+
"cert": "/working/tls.cert"
14+
}
15+
]
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Thank you for installing simln.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- define "mychart.name" -}}
2+
{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}
3+
{{- end -}}
4+
5+
{{- define "mychart.fullname" -}}
6+
{{- printf "%s-%s" (include "mychart.name" .) .Release.Name | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "mychart.fullname" . }}-data
5+
data:
6+
sim.json: |
7+
{{ .Files.Get "files/sim.json" | nindent 4 }}
8+
tls.cert: |
9+
-----BEGIN CERTIFICATE-----
10+
MIIB8TCCAZagAwIBAgIUJDsR6mmY+TaO9pCfjtotlbOkzJMwCgYIKoZIzj0EAwIw
11+
MjEfMB0GA1UECgwWbG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2Fy
12+
bmV0MB4XDTI0MTExMTE2NTM1MFoXDTM0MTEwOTE2NTM1MFowMjEfMB0GA1UECgwW
13+
bG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2FybmV0MFkwEwYHKoZI
14+
zj0CAQYIKoZIzj0DAQcDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLP
15+
tp0fxE7hmteSt6gjQriy90fP8j9OJXBNAjt915kLY4zVvqOBiTCBhjAOBgNVHQ8B
16+
Af8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUwAwEB/zAd
17+
BgNVHQ4EFgQU5d8QMrwhLgTkDjWA+eXZGz+dybUwLwYDVR0RBCgwJoIJbG9jYWxo
18+
b3N0ggEqhwR/AAABhxAAAAAAAAAAAAAAAAAAAAABMAoGCCqGSM49BAMCA0kAMEYC
19+
IQDPofN0fEl5gTwCYhk3nZbjMqJhZ8BsSJ6K8XRhxr7zbwIhAPsgQCFOqUWg632O
20+
NEO53OQ6CIqnpxSskjsFNH4ZBQOE
21+
-----END CERTIFICATE-----
22+
tls.key: |
23+
-----BEGIN EC PRIVATE KEY-----
24+
MHcCAQEEIIcFtWTLQv5JaRRxdkPKkO98OrvgeztbZ7h8Ev/4UbE4oAoGCCqGSM49
25+
AwEHoUQDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLPtp0fxE7hmteS
26+
t6gjQriy90fP8j9OJXBNAjt915kLY4zVvg==
27+
-----END EC PRIVATE KEY-----
28+
admin.macaroon.hex: |
29+
0201036c6e6402f801030a1062beabbf2a614b112128afa0c0b4fdd61201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e657261746512047265616400000620b17be53e367290871681055d0de15587f6d1cd47d1248fe2662ae27f62cfbdc6
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: {{ include "mychart.fullname" . }}
5+
labels:
6+
app: {{ include "mychart.name" . }}
7+
mission: {{ .Values.name }}
8+
spec:
9+
initContainers:
10+
- name: "init-container"
11+
image: "busybox"
12+
command:
13+
- "sh"
14+
- "-c"
15+
args:
16+
- >
17+
cp /configmap/* /working;
18+
cd /working;
19+
cat admin.macaroon.hex | xxd -r -p > admin.macaroon
20+
volumeMounts:
21+
- name: {{ .Values.workingVolume.name }}
22+
mountPath: {{ .Values.workingVolume.mountPath }}
23+
- name: {{ .Values.configmapVolume.name }}
24+
mountPath: {{ .Values.configmapVolume.mountPath }}
25+
containers:
26+
- name: {{ .Values.name }}
27+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
28+
imagePullPolicy: {{ .Values.image.pullPolicy }}
29+
command:
30+
- "sh"
31+
- "-c"
32+
args:
33+
- >
34+
cd /working;
35+
sim-cli
36+
volumeMounts:
37+
- name: {{ .Values.workingVolume.name }}
38+
mountPath: {{ .Values.workingVolume.mountPath }}
39+
- name: {{ .Values.configmapVolume.name }}
40+
mountPath: {{ .Values.configmapVolume.mountPath }}
41+
volumes:
42+
- name: {{ .Values.configmapVolume.name }}
43+
configMap:
44+
name: {{ include "mychart.fullname" . }}-data
45+
- name: {{ .Values.workingVolume.name }}
46+
emptyDir: {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "simln"
2+
image:
3+
repository: "mplsgrant/sim-ln"
4+
tag: "d8c165d"
5+
pullPolicy: IfNotPresent
6+
7+
workingVolume:
8+
name: working-volume
9+
mountPath: /working
10+
configmapVolume:
11+
name: configmap-volume
12+
mountPath: /configmap
13+
14+
defaultDataDir: /app/data

resources/plugins/simln/plugin.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enabled: true

0 commit comments

Comments
 (0)