1
- ## Local/Development environment
1
+ # Local/Development environment
2
2
3
3
Enduro uses Tilt to set up a local environment building the Docker images in a
4
4
Kubernetes cluster. It has been tested with k3d, Minikube and Kind.
5
5
6
- ### Requirements
6
+ ## Requirements
7
7
8
8
- [ Docker] (v18.09+)
9
9
- [ kubectl]
@@ -24,18 +24,19 @@ so that you don’t have to run Tilt with `sudo`. *Note that managing Docker as
24
24
non-root user is ** different** from running the docker daemon as a non-root user
25
25
(rootless).*
26
26
27
- #### Dex host
27
+ ### Dex host
28
28
29
29
To make authentication work from the host browser and from within the cluster,
30
30
the following entry needs to be added to your ` /etc/hosts ` file:
31
31
32
- ```
32
+ ``` text
33
33
127.0.0.1 dex
34
34
```
35
+
35
36
For Windows/WSL2 users, open Notepad, as an Administrator, and then add the above
36
37
to your ` etc/hosts ` file located like ` C:/Windows/System32/drivers/etc/hosts ` .
37
38
38
- ### Requirements for development
39
+ ## Requirements for development
39
40
40
41
While we run the services inside a Kubernetes cluster we recomend to install
41
42
Go, Node and other tools locally to ease the development process.
@@ -46,7 +47,7 @@ Go, Node and other tools locally to ease the development process.
46
47
47
48
If using Linux, Node.js binary distributions are available from [ NodeSource] .
48
49
49
- ### Editor
50
+ ## Editor
50
51
51
52
As source-code editor, we strongly recommended [ Visual Studio Code] for its
52
53
great out-of-the-box support for Go and TypeScript. The project includes some
@@ -59,51 +60,51 @@ extensions:
59
60
- Prettier - Code formatter
60
61
- ESLint
61
62
62
- ### Set up
63
+ ## Set up
63
64
64
65
Start a local Kubernetes cluster with a local registry. For example, with k3d:
65
66
66
- ```
67
+ ``` bash
67
68
k3d cluster create sdps-local --registry-create sdps-registry
68
69
```
69
70
70
71
Make sure kubectl is available and configured to use that cluster:
71
72
72
- ```
73
+ ``` bash
73
74
kubectl config view
74
75
```
75
76
76
77
Clone this repository and move into its folder if you have not done that
77
78
previously:
78
79
79
- ```
80
+ ``` bash
80
81
git clone git@github.com:artefactual-sdps/enduro.git
81
82
cd enduro
82
83
```
83
84
84
85
Bring up the environment:
85
86
86
- ```
87
+ ``` bash
87
88
tilt up
88
89
```
89
90
90
91
While the Docker images are built/downloaded and the Kubernetes resources are
91
92
created, hit ` space ` to open the Tilt UI in your browser. Check the [ Tilt UI]
92
93
documentation to know more about it.
93
94
94
- ### Access
95
+ ## Access
95
96
96
97
There are four services available from the host:
97
98
98
- - Enduro dashboard: http://localhost:8080
99
- - Minio console: http://localhost:7460 (username: minio, password: minio123)
100
- - Temporal UI: http://localhost:7440
99
+ - Enduro dashboard: < http://localhost:8080 >
100
+ - Minio console: < http://localhost:7460 > (username: minio, password: minio123)
101
+ - Temporal UI: < http://localhost:7440 >
101
102
102
- ### Live updates
103
+ ## Live updates
103
104
104
105
Tilt, by default, will watch for file changes in the project folder and it will
105
106
sync those changes, rebuild the Docker images and recreate the resources when
106
- necessary. However, we have * disabled * auto-load within the Tiltfile to reduce
107
+ necessary. However, we have _ disabled _ auto-load within the Tiltfile to reduce
107
108
the use of hardware resources. There are refresh buttons on each resource in the
108
109
Tilt UI that allow triggering manual updates and re-executing jobs and local
109
110
resources. You can also set the ` trigger_mode ` env string to ` TRIGGER_MODE_AUTO `
@@ -113,47 +114,48 @@ The `enduro-dashboard` uses Vite to serve the application in development
113
114
with hot reload. The ` enduro ` and ` enduro-a3m-worker ` services require rebuilding
114
115
the entire images - these will take longer to update.
115
116
116
- ### Stop/start the environment
117
+ ## Stop/start the environment
117
118
118
119
Run ` ctrl-c ` on the terminal where ` tilt up ` is running and stop the cluster
119
120
with:
120
121
121
- ```
122
+ ``` bash
122
123
k3d cluster stop sdps-local
123
124
```
124
125
125
126
To start the environment again:
126
127
127
- ```
128
+ ``` bash
128
129
k3d cluster start sdps-local
129
130
tilt up
130
131
```
131
132
132
- ### Clear the cluster
133
+ ## Clear the cluster
133
134
134
135
> Check the Tilt UI helpers below to just flush the existing data.
135
136
136
137
To remove the resources created by Tilt in the cluster, execute:
137
138
138
- ```
139
+ ``` bash
139
140
tilt down
140
141
```
142
+
141
143
Note that it will take some time to delete the persistent volumes when you
142
144
run ` tilt down ` and flushing the existing data does not delete the cluster.
143
145
To delete the volumes immediately, you can delete the cluster.
144
146
145
- ### Delete the cluster
147
+ ## Delete the cluster
146
148
147
149
Deleting the cluster will remove all the resources immediatly, deleting
148
150
cluster container from the host. With k3d, run:
149
151
150
- ```
152
+ ``` bash
151
153
k3d cluster delete sdps-local
152
154
```
153
155
154
- ### Tilt UI helpers
156
+ ## Tilt UI helpers
155
157
156
- #### Upload to Minio
158
+ ### Upload to Minio
157
159
158
160
In the Tilt UI header there is a cloud icon/button that allows you to configure
159
161
and trigger an upload to the ` sips ` bucket in Minio. Click the caret to set the
@@ -169,19 +171,19 @@ sure you update `/path/to/enduro` to the proper project folder in the host):
169
171
Alternatively, you can use the Enduro API to upload the file like in the
170
172
following example:
171
173
172
- ```
174
+ ``` bash
173
175
curl \
174
176
-F " file=@/path/to/enduro/hack/sampledata/StructB-AM.zip" \
175
177
http://localhost:9000/upload/upload
176
178
```
177
179
178
- #### Flush
180
+ ### Flush
179
181
180
182
Also in the Tilt UI header, click the trash button to flush the existing data.
181
183
This will recreate the MySQL databases and the MinIO buckets, and restart the
182
184
required resources.
183
185
184
- #### Generators
186
+ ### Generators
185
187
186
188
Grouped as tools, there are some code generators:
187
189
@@ -192,9 +194,9 @@ Grouped as tools, there are some code generators:
192
194
This resources need to be triggered manually by default, but they can be
193
195
configured to run automatically on code changes in the Tilt UI.
194
196
195
- ### Known issues
197
+ ## Known issues
196
198
197
- #### Minio uploads don't trigger workflows
199
+ ### MinIO uploads don't trigger workflows
198
200
199
201
The setup of the Minio buckets and the communication between Minio and Redis
200
202
is sometimes not setup properly. To solve it, from the Tilt UI, restart the
0 commit comments