Skip to content

Commit 01e1668

Browse files
committed
ci: upgrade validation workflow
Signed-off-by: mikeee <[email protected]>
1 parent 5dbfee5 commit 01e1668

File tree

6 files changed

+109
-23
lines changed

6 files changed

+109
-23
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"daprd": "0.0.0-dev",
3+
"dashboard": "0.0.0-dev",
4+
"cli": "0.0.0-dev",
5+
"daprBinarySubDir": "dist",
6+
"dockerImageSubDir": "docker",
7+
"daprImageName": "daprio/dapr:0.0.0-dev",
8+
"daprImageFileName": "daprio-dapr-0.0.0-dev.tar.gz"
9+
}

.github/workflows/validate_examples.yaml

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ jobs:
100100
run: |
101101
cd cli
102102
make
103-
echo "artifactPath=$HOME/artifacts/$GITHUB_SHA" >> $GITHUB_ENV
103+
echo "artifactPath=~/artifacts/$GITHUB_SHA/" >> $GITHUB_ENV
104104
mkdir -p $HOME/artifacts/$GITHUB_SHA/
105-
sudo cp dist/linux_amd64/release/dapr $artifactpath/dapr
105+
cp dist/linux_amd64/release/dapr $HOME/artifacts/$GITHUB_SHA/dapr
106106
CLI_VERSION=edge
107107
echo "DAPR_CLI_VER=$CLI_VERSION" >> $GITHUB_ENV
108108
@@ -111,16 +111,61 @@ jobs:
111111
run: |
112112
cd dapr_runtime
113113
make
114-
mkdir -p $HOME/artifacts/$GITHUB_SHA/
115-
cp dist/linux_amd64/release/* $artifactPath
114+
echo "artifactPath=~/artifacts/$GITHUB_SHA/" >> $GITHUB_ENV
116115
RUNTIME_VERSION=edge
117116
echo "DAPR_RUNTIME_VER=$RUNTIME_VERSION" >> $GITHUB_ENV
118117
119118
- name: Build Docker Image
120119
if: env.DAPR_REF != ''
121120
run: |
121+
mkdir ~/dapr_docker
122122
cd dapr_runtime
123-
docker build --build-arg "PKG_FILES=*" -f ./docker/Dockerfile ./dist/linux_amd64/release -t daprio/dapr:edge-linux-amd64 --output type=tar,dest=$artifactPath/dapr_docker.tar
123+
docker build --build-arg "PKG_FILES=*" -f ./docker/Dockerfile ./dist/linux_amd64/release -t daprio/dapr:0.0.0-dev
124+
125+
- name: Download Install Bundle CLI
126+
if: env.DAPR_REF != '' && env.DAPR_CLI_REF == ''
127+
run: |
128+
mkdir -p cli/dist/linux_amd64/release
129+
cd cli/dist/linux_amd64/release/
130+
curl -L --remote-name https://github.com/dapr/cli/releases/download/v$DAPR_CLI_VER/dapr_linux_amd64.tar.gz
131+
tar xvzf dapr_linux_amd64.tar.gz
132+
ls -la
133+
134+
- name: Build Custom Install Bundle
135+
if: env.DAPR_REF != '' && env.DAPR_CLI_REF != ''
136+
run: |
137+
: # Create daprbundle
138+
mkdir ~/daprbundle
139+
140+
cp .github/workflows/validate-examples/details.json ~/daprbundle/
141+
142+
: # Add cli
143+
cp ~/artifacts/$GITHUB_SHA/dapr ~/daprbundle/dapr
144+
145+
: # Zip daprd/dashboard/placement/scheduler/sentry /dist/ appending _linux_amd64 to tar.gz
146+
mkdir ~/daprbundle/dist
147+
cd dapr_runtime/dist/linux_amd64/release/
148+
for file in $(ls -1)
149+
do
150+
echo "packing $file"
151+
tar czvf ~/daprbundle/dist/${file}_linux_amd64.tar.gz ${file}
152+
done
153+
154+
cd ~/daprbundle/dist/
155+
curl -L --remote-name https://github.com/dapr/dashboard/releases/download/v0.14.0/dashboard_linux_amd64.tar.gz
156+
157+
: # Add docker image
158+
mkdir ~/daprbundle/docker
159+
docker save daprio/dapr:0.0.0-dev | gzip > ~/daprbundle/docker/daprio-dapr-0.0.0-dev.tar.gz
160+
161+
: # Bundle
162+
cd ~/daprbundle
163+
tar czvf $HOME/artifacts/$GITHUB_SHA/daprbundle.tar.gz .
164+
165+
- name: List artifacts
166+
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
167+
run: |
168+
ls -la $HOME/artifacts/$GITHUB_SHA/
124169
125170
- name: Upload dapr-artifacts
126171
uses: actions/upload-artifact@v4
@@ -190,24 +235,19 @@ jobs:
190235
uses: actions/download-artifact@v4
191236
with:
192237
name: dapr-artifacts
193-
path: $HOME/artifacts/$GITHUB_SHA/
238+
path: ~/artifacts/${{ env.GITHUB_SHA }}
194239

195240
- name: Display downloaded artifacts
196241
if: env.DAPR_CLI_VER == 'edge' || env.DAPR_RUNTIME_VER == 'edge'
197242
run: |
198-
ls ~/artifacts/$GITHUB_SHA
243+
ls -la $HOME/artifacts/$GITHUB_SHA/
199244
200245
- name: Set up Go
201246
id: setup-go
202247
uses: actions/setup-go@v5
203248
with:
204249
go-version-file: "go.mod"
205250

206-
- name: Import Dapr Image (edge)
207-
if: env.DAPR_RUNTIME_VER == 'edge'
208-
run: |
209-
cat $HOME/artifacts/$GITHUB_SHA/dapr_docker.tar | docker import - daprio/dapr:edge
210-
211251
- name: Set up Dapr CLI
212252
if: env.DAPR_CLI_VER != 'edge'
213253
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
@@ -216,17 +256,30 @@ jobs:
216256
if: env.DAPR_CLI_VER == 'edge'
217257
run: |
218258
sudo cp $HOME/artifacts/$GITHUB_SHA/dapr /usr/local/bin/dapr
259+
sudo chmod +x /usr/local/bin/dapr
219260
220261
- name: Initialize Dapr runtime ${{ env.DAPR_RUNTIME_VER }}
262+
if: env.DAPR_RUNTIME_VER != 'edge'
221263
run: |
222264
dapr uninstall --all
223265
dapr init --runtime-version ${{ env.DAPR_RUNTIME_VER }}
224266
225-
- name: Override daprd with referenced commit.
267+
- name: Initialize Dapr runtime EDGE
226268
if: env.DAPR_RUNTIME_VER == 'edge'
227269
run: |
228-
mkdir -p $HOME/.dapr/bin/
229-
cp $HOME/artifacts/$GITHUB_SHA/daprd $HOME/.dapr/bin/daprd
270+
: # Unpack Bundle
271+
mkdir ~/daprbundle
272+
tar xvzf $HOME/artifacts/$GITHUB_SHA/daprbundle.tar.gz -C ~/daprbundle
273+
274+
: # Run installer
275+
dapr uninstall --all
276+
dapr init --from-dir ~/daprbundle/
277+
278+
: # Initialize redis and zipkin
279+
docker run --name "dapr_redis" --restart always -d -p 6379:6379 redislabs/rejson
280+
docker run --name "dapr_zipkin" --restart always -d -p 9411:9411 openzipkin/zipkin
281+
282+
docker ps -a
230283
231284
- name: Set up Python ${{ env.PYTHON_VER }}
232285
uses: actions/setup-python@v5

examples/hello-world/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ expected_stdout_lines:
8989
-->
9090

9191
```bash
92-
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error -- ./order put --id 20
92+
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error --resources-path ./config -- ./order put --id 20
9393
```
9494

9595
<!-- END_STEP -->
@@ -105,7 +105,7 @@ expected_stdout_lines:
105105
-->
106106

107107
```bash
108-
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error ./order get
108+
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error --resources-path ./config ./order get
109109
```
110110

111111
<!-- END_STEP -->
@@ -116,7 +116,7 @@ dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error ./order get
116116
Alternatively, you can start a standalone Dapr runtime, and call the app from another shell:
117117

118118
```bash
119-
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error
119+
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error --resources-path ./config
120120
```
121121

122122

@@ -140,7 +140,7 @@ You can run more than one app in Dapr runtime. In this example you will call `or
140140
Another instance of the `order` app will read the state.
141141

142142
```sh
143-
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error ./order seq
143+
dapr run --app-id order-app --dapr-grpc-port 3500 --log-level error --resources-path ./config ./order seq
144144
```
145145

146146
```sh
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: statestore
5+
spec:
6+
type: state.redis
7+
version: v1
8+
metadata:
9+
- name: redisHost
10+
value: localhost:6379
11+
- name: redisPassword
12+
value: ""

examples/socket/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ expected_stdout_lines:
7777
-->
7878

7979
```bash
80-
dapr run --app-id order-app --log-level error --unix-domain-socket /tmp -- ./order put --id 20
80+
dapr run --app-id order-app --log-level error --resources-path ./config --unix-domain-socket /tmp -- ./order put --id 20
8181
```
8282

8383
<!-- END_STEP -->
@@ -93,15 +93,15 @@ expected_stdout_lines:
9393
-->
9494

9595
```bash
96-
dapr run --app-id order-app --log-level error --unix-domain-socket /tmp ./order get
96+
dapr run --app-id order-app --log-level error --resources-path ./config --unix-domain-socket /tmp ./order get
9797
```
9898

9999
<!-- END_STEP -->
100100

101101
Alternatively, you can start a standalone Dapr runtime, and call the app from another shell:
102102

103103
```bash
104-
dapr run --app-id order-app --log-level error --unix-domain-socket /tmp
104+
dapr run --app-id order-app --log-level error --resources-path ./config --unix-domain-socket /tmp
105105
```
106106

107107

@@ -124,7 +124,7 @@ You can run more than one app in Dapr runtime. In this example you will call `or
124124
Another instance of the `order` app will read the state.
125125

126126
```sh
127-
dapr run --app-id order-app --log-level error --unix-domain-socket /tmp ./order seq
127+
dapr run --app-id order-app --log-level error --resources-path ./config --unix-domain-socket /tmp ./order seq
128128
```
129129

130130
```sh

examples/socket/config/redis.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: statestore
5+
spec:
6+
type: state.redis
7+
version: v1
8+
metadata:
9+
- name: redisHost
10+
value: localhost:6379
11+
- name: redisPassword
12+
value: ""

0 commit comments

Comments
 (0)