Skip to content

Commit

Permalink
Some text fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cnunciato committed Jul 3, 2024
1 parent ce94281 commit 12c19d0
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 117 deletions.
224 changes: 112 additions & 112 deletions .github/workflows/run-tests-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,35 +81,35 @@ jobs:
- testing-unit-cs
- testing-unit-cs-mocks
- testing-unit-fs-mocks
go-unit-testing:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
name: Running ${{ matrix.source-dir }} test
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Install Pulumi CLI
uses: pulumi/actions@v5
with:
pulumi-version: dev
- name: Print CLI version
run: echo "Currently Pulumi $(pulumi version) is installed"
- run: go test
working-directory: ${{ matrix.source-dir }}
strategy:
fail-fast: false
matrix:
goversion:
- 1.21.x
platform:
- ubuntu-latest
source-dir:
- testing-unit-go
# go-unit-testing:
# if: github.event_name == 'repository_dispatch' ||
# github.event.pull_request.head.repo.full_name == github.repository
# name: Running ${{ matrix.source-dir }} test
# runs-on: ${{ matrix.platform }}
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Install Go
# uses: actions/setup-go@v2
# with:
# go-version: ${{matrix.goversion}}
# - name: Install Pulumi CLI
# uses: pulumi/actions@v5
# with:
# pulumi-version: dev
# - name: Print CLI version
# run: echo "Currently Pulumi $(pulumi version) is installed"
# - run: go test
# working-directory: ${{ matrix.source-dir }}
# strategy:
# fail-fast: false
# matrix:
# goversion:
# - 1.21.x
# platform:
# - ubuntu-latest
# source-dir:
# - testing-unit-go
kubernetes:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
Expand Down Expand Up @@ -374,76 +374,76 @@ jobs:
fail-fast: false
matrix:
clouds:
- DigitalOcean
# - DigitalOcean
- Aws
- Azure
# - Azure
- Gcp
- Packet
- EquinixMetal
- Cloud
# - Packet
# - EquinixMetal
# - Cloud
dotnetversion:
- 6.0.114
goversion:
- 1.21.x
languages:
- Cs
- Js
# - Cs
# - Js
- Ts
- Py
- Fs
# - Py
# - Fs
nodeversion:
- 18.x
platform:
- ubuntu-latest
pythonversion:
- 3.9
python-unit-testing:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
name: Running ${{ matrix.source-dir }} test
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{matrix.pythonversion}}
- name: Install Python deps
run: |-
pip3 install virtualenv==20.0.23
pip3 install pipenv
- name: Install Pulumi CLI
uses: pulumi/actions@v5
with:
pulumi-version: dev
- name: Print CLI version
run: echo "Currently Pulumi $(pulumi version) is installed"
- run: |-
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python -m unittest
working-directory: ${{ matrix.source-dir }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
pythonversion:
- 3.9
source-dir:
- testing-unit-py
# python-unit-testing:
# if: github.event_name == 'repository_dispatch' ||
# github.event.pull_request.head.repo.full_name == github.repository
# name: Running ${{ matrix.source-dir }} test
# runs-on: ${{ matrix.platform }}
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: ${{matrix.pythonversion}}
# - name: Install Python deps
# run: |-
# pip3 install virtualenv==20.0.23
# pip3 install pipenv
# - name: Install Pulumi CLI
# uses: pulumi/actions@v5
# with:
# pulumi-version: dev
# - name: Print CLI version
# run: echo "Currently Pulumi $(pulumi version) is installed"
# - run: |-
# python3 -m venv venv
# source venv/bin/activate
# pip3 install -r requirements.txt
# python -m unittest
# working-directory: ${{ matrix.source-dir }}
# strategy:
# fail-fast: false
# matrix:
# platform:
# - ubuntu-latest
# pythonversion:
# - 3.9
# source-dir:
# - testing-unit-py
status-checks:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name
name: Final Status Check
needs:
- dotnet-unit-testing
- go-unit-testing
- python-unit-testing
- ts-unit-testing
- kubernetes
# - go-unit-testing
# - python-unit-testing
# - ts-unit-testing
# - kubernetes
- linting
- providers
runs-on: ubuntu-latest
Expand Down Expand Up @@ -666,36 +666,36 @@ jobs:
- ubuntu-latest
pythonversion:
- 3.9
ts-unit-testing:
if: github.event_name == 'repository_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
name: Running ${{ matrix.source-dir }} test
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Install Pulumi CLI
uses: pulumi/actions@v5
with:
pulumi-version: dev
- name: Print CLI version
run: echo "Currently Pulumi $(pulumi version) is installed"
- run: |-
npm install
npx mocha -r ts-node/register ec2tests.ts
npx mocha -r ts-node/register bucket_pair_test.ts
working-directory: ${{ matrix.source-dir }}/mocha
strategy:
fail-fast: false
matrix:
nodeversion:
- 20.x
platform:
- ubuntu-latest
source-dir:
- testing-unit-ts
# ts-unit-testing:
# if: github.event_name == 'repository_dispatch' ||
# github.event.pull_request.head.repo.full_name == github.repository
# name: Running ${{ matrix.source-dir }} test
# runs-on: ${{ matrix.platform }}
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
# - name: Setup Node
# uses: actions/setup-node@v4
# with:
# node-version: ${{matrix.nodeversion}}
# registry-url: https://registry.npmjs.org
# - name: Install Pulumi CLI
# uses: pulumi/actions@v5
# with:
# pulumi-version: dev
# - name: Print CLI version
# run: echo "Currently Pulumi $(pulumi version) is installed"
# - run: |-
# npm install
# npx mocha -r ts-node/register ec2tests.ts
# npx mocha -r ts-node/register bucket_pair_test.ts
# working-directory: ${{ matrix.source-dir }}/mocha
# strategy:
# fail-fast: false
# matrix:
# nodeversion:
# - 20.x
# platform:
# - ubuntu-latest
# source-dir:
# - testing-unit-ts
46 changes: 44 additions & 2 deletions aws-ts-lambda-efs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,59 @@ export = async () => {
rootDirectory: { path: "/www", creationInfo: { ownerGid: 1000, ownerUid: 1000, permissions: "755" } },
}, { dependsOn: targets });

// Function to create a delay using setTimeout and a Promise
function delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}

// Create a Pulumi component resource that waits for 10 seconds
class WaitResource extends pulumi.ComponentResource {
constructor(name: string, args = {}, opts?: pulumi.ResourceOptions) {
super("custom:resource:WaitResource", name, args, opts);

// Create a delay of 10 seconds
const wait = delay(60000).then(() => {
this.registerOutputs();
});

// Register the wait promise as an output
this.registerOutputs({ wait });
}
}

// Instantiate the wait resource
const waitResource = new WaitResource("waitResource", {}, { dependsOn: targets });

const lambdaRole = new aws.iam.Role("lambda-role", {
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Principal: {
Service: "lambda.amazonaws.com",
},
Effect: "Allow",
}],
}),

managedPolicyArns: [
aws.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole,
aws.iam.ManagedPolicy.LambdaFullAccess,
],
});

// Lambda
function efsvpcCallback(name: string, f: aws.lambda.Callback<APIGatewayProxyEvent, APIGatewayProxyResult>) {
return new aws.lambda.CallbackFunction(name, {
policies: [aws.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole, aws.iam.ManagedPolicy.LambdaFullAccess],
role: lambdaRole,

vpcConfig: {
subnetIds: vpc.privateSubnetIds,
securityGroupIds: [vpc.vpc.defaultSecurityGroupId],
},
fileSystemConfig: { arn: ap.arn, localMountPath: "/mnt/storage" },
callback: f,
}, {dependsOn: targets});
}, {dependsOn: [waitResource]});
}

// API Gateway
Expand Down
6 changes: 6 additions & 0 deletions gcp-ts-cloudrun/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const myImage = new docker.Image(imageName, {
imageName: pulumi.interpolate`gcr.io/${gcp.config.project}/${imageName}:v1.0.0`,
build: {
context: "./app",
platform: "linux/amd64",
},
});

Expand All @@ -65,6 +66,11 @@ const rubyService = new gcp.cloudrun.Service("ruby", {
memory: "1Gi",
},
},
ports: [
{
containerPort: 8080,
},
],
}],
containerConcurrency: 50,
},
Expand Down
2 changes: 1 addition & 1 deletion gcp-ts-cloudrun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@types/node": "^12.0.0"
},
"dependencies": {
"@pulumi/docker": "^3.0.0",
"@pulumi/docker": "^4.0.0",
"@pulumi/gcp": "^7.0.0",
"@pulumi/pulumi": "^3.0.0"
}
Expand Down
3 changes: 1 addition & 2 deletions misc/test/google_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ func TestAccGcpTsServerlessRaw(t *testing.T) {
func TestAccGcpTsCloudRun(t *testing.T) {
test := getGoogleBase(t).
With(integration.ProgramTestOptions{
Dir: path.Join(getCwd(t), "..", "..", "gcp-ts-cloudrun"),
RunUpdateTest: false,
Dir: path.Join(getCwd(t), "..", "..", "gcp-ts-cloudrun"),
ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) {
endpoint := stack.Outputs["rubyUrl"].(string)
helpers.AssertHTTPResult(t, endpoint, nil, func(body string) bool {
Expand Down

0 comments on commit 12c19d0

Please sign in to comment.