Skip to content

Commit 2227a1c

Browse files
authored
Remove Fixed Dapr Version Constraint (drasi-project#147)
* updated mongo statestore * updated e2e test settings * nit * updated devskim version * updated timeout value * test fix * nit * added a comment explaining the changes * minor fix * dapr label selector * dapr label selector * updated based on PR comments * use service name in mongo connectionString
1 parent db01976 commit 2227a1c

File tree

6 files changed

+30
-29
lines changed

6 files changed

+30
-29
lines changed

cli/cmd/init.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ Usage examples:
108108
initCommand.Flags().String("registry", config.Registry, "Container registry to pull images from.")
109109
initCommand.Flags().String("version", config.Version, "Container image version tag.")
110110
initCommand.Flags().StringP("namespace", "n", "drasi-system", "Kubernetes namespace to install Drasi into.")
111-
initCommand.Flags().String("dapr-runtime-version", "1.10.0", "Dapr runtime version to install.")
112-
initCommand.Flags().String("dapr-sidecar-version", "1.9.0", "Dapr sidecar (daprd) version to install.")
111+
initCommand.Flags().String("dapr-runtime-version", "", "Dapr runtime version to install.")
112+
initCommand.Flags().String("dapr-sidecar-version", "latest", "Dapr sidecar (daprd) version to install.")
113113
initCommand.Flags().String("dapr-registry", "docker.io/daprio", "Container registry to pull Dapr images from.")
114114
return initCommand
115115
}

cli/service/installer.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ func (t *Installer) installQueryContainer(output output.TaskOutput, namespace st
329329
if err := drasiClient.Apply(manifests, subOutput); err != nil {
330330
return err
331331
}
332-
if err := drasiClient.ReadyWait(manifests, 150, subOutput); err != nil {
332+
333+
if err := drasiClient.ReadyWait(manifests, 180, subOutput); err != nil {
333334
return err
334335
}
335336
output.SucceedTask("Query-Container", "Query container created")
@@ -625,7 +626,7 @@ func (t *Installer) checkDaprInstallation(output output.TaskOutput) (bool, error
625626
podsClient := t.kubeClient.CoreV1().Pods("dapr-system")
626627

627628
pods, err := podsClient.List(context.TODO(), metav1.ListOptions{
628-
LabelSelector: "app.kubernetes.io/name=dapr",
629+
LabelSelector: "app.kubernetes.io/part-of=dapr",
629630
})
630631
if err != nil {
631632
output.FailTask("Dapr-Check", fmt.Sprintf("Error checking for Dapr: %v", err.Error()))

cli/service/resources/infra.yaml

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Copyright 2024 The Drasi Authors.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
1+
# Copyright 2024 The Drasi Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
1515
apiVersion: scheduling.k8s.io/v1
1616
kind: PriorityClass
1717
metadata:
@@ -316,12 +316,12 @@ spec:
316316
type: state.mongodb
317317
version: v1
318318
metadata:
319-
- name: host
320-
value: drasi-mongo:27017
321-
- name: username
322-
value:
323-
- name: password
324-
value:
319+
- name: connectionString
320+
value: "mongodb://drasi-mongo:27017/?replicaSet=rs0"
321+
# The replicaSet parameter is required to enable MongoDB transactions.
322+
# Without this, MongoDB treats the connection as a standalone instance,
323+
# which does not support transactions (which ultimately means we won't be
324+
# able to use it as an actor statestore).
325325
- name: actorStateStore
326326
value: "true"
327327
---
@@ -344,4 +344,3 @@ spec:
344344
- name: redisPassword
345345
value: ""
346346

347-

e2e-tests/03-kubernetes-scenario/k8s.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ beforeAll(async () => {
5050
dbClient.port = await dbPortForward.start();
5151
await dbClient.connect();
5252
await new Promise((r) => setTimeout(r, 5000));
53-
}, 120000);
53+
}, 180000);
5454

5555
afterAll(async () => {
5656
await signalrFixture.stop();

e2e-tests/fixtures/signalr-fixture.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ function signalrReactionManifest(queryIds) {
189189
let result = {
190190
apiVersion: "v1",
191191
kind: "Reaction",
192-
name: `signalr-${crypto.randomUUID().toString()}`,
192+
name: `signalr-${crypto.randomUUID().toString()}`,
193+
// Sometimes the uuid will begin with a number, which is not allowed in k8s resource names
194+
// as a result, we prepend the name with 'signalr-' to ensure it is a valid name
193195
spec: {
194196
kind: "SignalR",
195197
queries: queryIds.reduce((a, v) => ({ ...a, [v]: "" }), {}),

reactions/platform/result-reaction/Program.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
}
3333

3434

35-
3635
builder.Services.AddSingleton<IResultViewClient, ResultViewClient>();
3736

3837

@@ -139,7 +138,7 @@ async IAsyncEnumerable<JsonElement> GetCurrentResultAtTimeStamp()
139138
});
140139

141140

142-
app.RunAsync();
141+
await app.RunAsync();
143142

144143
bool isValidQueryId(string queryId)
145144
{

0 commit comments

Comments
 (0)