Skip to content

Commit

Permalink
Merge branch 'edge' into add-dependabot-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
sk593 authored Jan 9, 2025
2 parents a813f2d + 539dadc commit d217437
Show file tree
Hide file tree
Showing 18 changed files with 395 additions and 755 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

## Create a k3d cluster
while (! kubectl cluster-info ); do
while (! kubectl cluster-info); do
# Docker takes a few seconds to initialize
echo "Waiting for Docker to launch..."
k3d cluster delete
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/purge-aws-eks-clusters.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Purge AWS EKS Clusters

on:
workflow_dispatch:
# Allows manual triggering of the workflow
schedule:
# Runs every day at 7 AM
- cron: "0 7 * * *"
Expand All @@ -17,11 +19,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install AWS CLI
run: |
sudo apt-get update
sudo apt-get install -y awscli
- name: Install eksctl
run: |
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/purge-aws-rds-snapshots.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Purge AWS RDS DBInstance snapshots
on:
workflow_dispatch:
# Allows manual triggering of the workflow
schedule:
# Runs at 00:30 and 12:30
- cron: "30 0,12 * * *"
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/purge-aws-test-resources.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Purge AWS Test Resources

on:
workflow_dispatch:
# Allows manual triggering of the workflow
schedule:
# Runs every day at 5 AM
- cron: "0 5 * * *"
Expand All @@ -17,11 +19,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install AWS CLI
run: |
sudo apt-get update
sudo apt-get install -y awscli
- name: Login to AWS
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -35,6 +32,6 @@ jobs:
- name: Create GitHub issue on failure
if: failure() && github.event_name == 'schedule'
run: |
gh issue create --title "Purge Purge AWS Test Resources workflow failed" \
gh issue create --title "Purge AWS Test Resources workflow failed" \
--body "Test failed on ${{ github.repository }}. See [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details." \
--repo ${{ github.repository }}
6 changes: 6 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ on:
- cron: "0 12 * * *"
env:
RUN_IDENTIFIER: samplestest-${{ github.run_id }}-${{ github.run_attempt }}
# ORAS (OCI Registry As Storage) CLI version
ORAS_VERSION: 1.1.0
jobs:
test:
name: Sample tests
Expand Down Expand Up @@ -251,6 +253,10 @@ jobs:
run: |
helm repo add dapr https://dapr.github.io/helm-charts/
helm install dapr dapr/dapr --version=1.6 --namespace dapr-system --create-namespace --wait
- uses: oras-project/setup-oras@main
if: steps.gen-id.outputs.RUN_TEST == 'true'
with:
oras-version: ${{ env.ORAS_VERSION }}
- name: Download rad CLI
if: steps.gen-id.outputs.RUN_TEST == 'true'
run: |
Expand Down
85 changes: 47 additions & 38 deletions playwright/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.43.1",
"@types/node": "^20.12.8",
"@types/uuid": "^9.0.8",
"typescript": "^5.4.5"
"@playwright/test": "^1.49.1",
"@types/node": "^22.10.3",
"@types/uuid": "^10.0.0",
"typescript": "^5.7.2"
},
"dependencies": {
"uuid": "^9.0.1"
"uuid": "^11.0.3"
}
}
2 changes: 1 addition & 1 deletion samples/dapr/nodeapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8-alpine
FROM node:22-alpine
WORKDIR /app
COPY . .
RUN npm install
Expand Down
16 changes: 8 additions & 8 deletions samples/dapr/nodeapp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ const app = express();
app.use(bodyParser.json());

// These ports are injected automatically into the container.
const daprPort = process.env.DAPR_HTTP_PORT;
const daprPort = process.env.DAPR_HTTP_PORT;
const daprGRPCPort = process.env.DAPR_GRPC_PORT;

const stateStoreName = process.env.CONNECTION_ORDERS_COMPONENTNAME;
const stateStoreName = process.env.CONNECTION_ORDERS_COMPONENTNAME;
const stateUrl = `http://localhost:${daprPort}/v1.0/state/${stateStoreName}`;
const port = 3000;

app.get('/order', (_req, res) => {
if (!process.env.DAPR_HTTP_PORT) {
res.status(400).send({message: "The container is running, but Dapr has not been configured."});
res.status(400).send({ message: "The container is running, but Dapr has not been configured." });
return;
}

if (!process.env.CONNECTION_ORDERS_COMPONENTNAME) {
res.status(400).send({message: "The container is running, but the state store name is not set."});
res.status(400).send({ message: "The container is running, but the state store name is not set." });
return;
}

Expand All @@ -37,13 +37,13 @@ app.get('/order', (_req, res) => {
return response.json();
}).then((orders) => {
if (orders.length === 0) {
res.send({ message: "no orders yet" })
res.send({ message: "no orders yet" })
} else {
res.send({ items: orders })
}
}).catch((error) => {
console.log(error);
res.status(500).send({message: error});
res.status(500).send({ message: error });
});
});

Expand Down Expand Up @@ -87,14 +87,14 @@ app.post('/neworder', (req, res) => {
res.status(200).send();
}).catch((error) => {
console.log(error);
res.status(500).send({message: error});
res.status(500).send({ message: error });
});
});

app.get('/ports', (_req, res) => {
console.log("DAPR_HTTP_PORT: " + daprPort);
console.log("DAPR_GRPC_PORT: " + daprGRPCPort);
res.status(200).send({DAPR_HTTP_PORT: daprPort, DAPR_GRPC_PORT: daprGRPCPort })
res.status(200).send({ DAPR_HTTP_PORT: daprPort, DAPR_GRPC_PORT: daprGRPCPort })
});

app.listen(port, () => console.log(`Node App listening on port ${port}!`));
Loading

0 comments on commit d217437

Please sign in to comment.