Skip to content

Commit

Permalink
Merge branch 'main' into renovate/c8-8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
pattishin committed Jun 28, 2023
2 parents 4774846 + 1ff99bd commit a90ba23
Show file tree
Hide file tree
Showing 31 changed files with 1,462 additions and 43 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ai-platform-snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
timeout-minutes: 360
permissions:
contents: 'write'
pull-requests: 'write'
Expand Down Expand Up @@ -98,12 +98,18 @@ jobs:
path: ai-platform/snippets/${{ env.MOCHA_REPORTER_OUTPUT }}
retention-days: 1
remove_label:
permissions:
contents: 'read'
id-token: 'write'
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'actions:force-run' &&
always()
uses: ./.github/workflows/remove-label.yaml
flakybot:
permissions:
contents: 'read'
id-token: 'write'
if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail
uses: ./.github/workflows/flakybot.yaml
needs: [test]
6 changes: 6 additions & 0 deletions .github/workflows/automl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,18 @@ jobs:
path: automl/${{ env.MOCHA_REPORTER_OUTPUT }}
retention-days: 1
remove_label:
permissions:
contents: 'read'
id-token: 'write'
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'actions:force-run' &&
always()
uses: ./.github/workflows/remove-label.yaml
flakybot:
permissions:
contents: 'read'
id-token: 'write'
if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail
uses: ./.github/workflows/flakybot.yaml
needs: [test]
7 changes: 4 additions & 3 deletions .github/workflows/functions-slack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ on:
- cron: '0 0 * * 0'
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'

if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
defaults:
run:
working-directory: 'functions/slack'
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/iam-deny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ on:
- cron: '0 0 * * 0'
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'

if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
defaults:
run:
working-directory: 'iam/deny'
Expand Down Expand Up @@ -89,12 +90,18 @@ jobs:
path: iam/deny/${{ env.MOCHA_REPORTER_OUTPUT }}
retention-days: 1
remove_label:
permissions:
contents: 'read'
id-token: 'write'
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'actions:force-run' &&
always()
uses: ./.github/workflows/remove-label.yaml
flakybot:
permissions:
contents: 'read'
id-token: 'write'
if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail
uses: ./.github/workflows/flakybot.yaml
needs: [test]
6 changes: 3 additions & 3 deletions .github/workflows/security-center-snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ on:
- cron: '0 0 * * 0'
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
defaults:
run:
working-directory: 'security-center/snippets'
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/storagetransfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ on:
- cron: '0 0 * * 0'
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
defaults:
run:
working-directory: 'storagetransfer'
Expand Down Expand Up @@ -101,12 +101,18 @@ jobs:
path: storagetransfer/${{ env.MOCHA_REPORTER_OUTPUT }}
retention-days: 1
remove_label:
permissions:
contents: 'read'
id-token: 'write'
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'actions:force-run' &&
always()
uses: ./.github/workflows/remove-label.yaml
flakybot:
permissions:
contents: 'read'
id-token: 'write'
if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail
uses: ./.github/workflows/flakybot.yaml
needs: [test]
9 changes: 9 additions & 0 deletions .github/workflows/utils/ci-matrix.yaml.njk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ on:
- cron: '0 0 * * 0'
jobs:
test:
permissions:
contents: 'read'
id-token: 'write'
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
strategy:
matrix:
Expand All @@ -45,12 +48,18 @@ jobs:
name: '{{name}}'
path: '${% raw %}{{ matrix.path }}{% endraw %}'
remove_label:
permissions:
contents: 'read'
id-token: 'write'
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'actions:force-run' &&
always()
uses: ./.github/workflows/remove-label.yaml
flakybot:
permissions:
contents: 'read'
id-token: 'write'
if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail
uses: ./.github/workflows/flakybot.yaml
needs: [test]
6 changes: 6 additions & 0 deletions .github/workflows/utils/ci-secrets.yaml.njk
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,18 @@ jobs:
path: {{ path }}/${% raw %}{{ env.MOCHA_REPORTER_OUTPUT }}{% endraw %}
retention-days: 1
remove_label:
permissions:
contents: 'read'
id-token: 'write'
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'actions:force-run' &&
always()
uses: ./.github/workflows/remove-label.yaml
flakybot:
permissions:
contents: 'read'
id-token: 'write'
if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail
uses: ./.github/workflows/flakybot.yaml
needs: [test]
6 changes: 3 additions & 3 deletions .github/workflows/vision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ on:
- cron: '0 0 * * 0'
jobs:
test:
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
runs-on: ubuntu-latest
timeout-minutes: 120
defaults:
run:
working-directory: 'vision'
Expand Down
4 changes: 2 additions & 2 deletions .kokoro/appengine/test-deployment/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ build_file: "nodejs-docs-samples/.kokoro/trampoline.sh"
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-docs-samples/nodejs"
value: "gcr.io/cloud-devrel-kokoro-resources/node"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build-with-appengine.sh"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const deleteFeaturestore = async () => {
await operation.promise();
};

describe('AI platform create featurestore with fixed nodes', async function () {
// TODO (#3302): Investigate Featurestore stability issue
describe.skip('AI platform create featurestore with fixed nodes', async function () {
this.retries(2);
it('should create a featurestore', async () => {
const stdout = execSync(
Expand Down
3 changes: 2 additions & 1 deletion ai-platform/snippets/test/create-featurestore-sample.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ const deleteFeaturestore = async () => {
await operation.promise();
};

describe('AI platform create featurestore', async function () {
// TODO (#3302): Investigate Featurestore stability issue
describe.skip('AI platform create featurestore', async function () {
this.retries(2);
it('should create a featurestore', async () => {
const stdout = execSync(
Expand Down
82 changes: 82 additions & 0 deletions ai-platform/snippets/test/tuning.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* eslint-disable */

'use strict';

const {assert} = require('chai');
const {describe, it} = require('mocha');
const uuid = require('uuid')
const sinon = require('sinon');

const aiplatform = require('@google-cloud/aiplatform');
const clientOptions = {
apiEndpoint: 'europe-west4-aiplatform.googleapis.com',
};
const pipelineClient = new aiplatform.v1.PipelineServiceClient(clientOptions);

const {tuneModel} = require('../tuning');

const projectId = process.env.CAIP_PROJECT_ID;
const location = 'europe-west4';
const timestampId = `${new Date().toISOString().replace(/(:|\.)/g, '-').toLowerCase()}`
const pipelineJobName = `my-tuning-pipeline-${timestampId}`
const modelDisplayName = `my-tuned-model-${timestampId}`
const bucketName = `ucaip-samples-europe-west4/training_pipeline_output`;
const bucketUri = `gs://${bucketName}/tune-model-nodejs`

describe('Tune a model', () => {
const stubConsole = function () {
sinon.stub(console, 'error');
sinon.stub(console, 'log');
};

const restoreConsole = function () {
console.log.restore();
console.error.restore();
};

after(async () => {
// Cancel and delete the pipeline job
const name = pipelineClient.pipelineJobPath(
projectId,
location,
pipelineJobName
);

const cancelRequest = {
name,
};

pipelineClient.cancelPipelineJob(cancelRequest).then(() => {
const deleteRequest = {
name,
};

return pipelineClient.deletePipeline(deleteRequest);
});
});

beforeEach(stubConsole);
afterEach(restoreConsole);

it('should prompt-tune an existing model', async () => {
// Act
await tuneModel(projectId, pipelineJobName, modelDisplayName, bucketUri);

// Assert
assert.include(console.log.firstCall.args, 'Tuning pipeline job:');
});
});
Loading

0 comments on commit a90ba23

Please sign in to comment.