Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into vg-bl-check-memory
Browse files Browse the repository at this point in the history
  • Loading branch information
vicky-g committed Jun 16, 2022
2 parents 247b1b1 + 3941a7d commit 054316a
Show file tree
Hide file tree
Showing 408 changed files with 41,800 additions and 4,859 deletions.
73 changes: 65 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ commands:
steps:
- run: ./diff.sh << parameters.service >> || (echo "no diff" && circleci-agent step halt)

# global parameters
parameters:
full_ci:
type: boolean
default: false

jobs:
bake-gcp-dev-image:
docker:
Expand Down Expand Up @@ -69,6 +75,16 @@ jobs:
# Run A up on remote box
GCLOUD_IP_ADDRESS=$(gcloud compute instances describe $GCLOUD_VM_NAME --format='get(networkInterfaces[0].accessConfigs[0].natIP)')
ssh -o "StrictHostKeyChecking no" -i ~/.ssh/google_compute_engine -tt ubuntu@$GCLOUD_IP_ADDRESS \<< EOF
# fail on error
set -e;
# on error, run this function
exit_ssh() {
echo $?
}
trap exit_ssh EXIT
# commands to prime the VM for the bake
A run init-repos up;
A up;
A down;
Expand Down Expand Up @@ -140,9 +156,13 @@ jobs:
# Run A up on remote box
GCLOUD_IP_ADDRESS=$(gcloud compute instances describe $GCLOUD_VM_NAME --format='get(networkInterfaces[0].accessConfigs[0].natIP)')
ssh -o "StrictHostKeyChecking no" -i ~/.ssh/google_compute_engine -tt ubuntu@$GCLOUD_IP_ADDRESS \<< EOF
cd /home/ubuntu/audius-protocol/mad-dog;
cd /home/ubuntu/audius-protocol;
git pull;
git checkout $CIRCLE_BRANCH;
cd ./service-commands;
npm i
cd ../mad-dog;
A run init-repos up;
A up;
npm run start << parameters.mad-dog-type >> verbose;
exit;
Expand Down Expand Up @@ -224,7 +244,7 @@ jobs:
test-contracts:
docker:
- image: circleci/node:10.16.3
- image: circleci/node:16
- image: trufflesuite/ganache-cli:latest
command: ['--port=8555', '-a', '100', '-l', '8000000']
steps:
Expand Down Expand Up @@ -265,7 +285,7 @@ jobs:
# uses medium (2vcpu/4gb) by default
resource_class: medium
docker:
- image: circleci/node:14.17.3
- image: circleci/node:16
- image: trufflesuite/ganache-cli:latest
command: ['--port=8546', '-a', '50', '-l', '8000000']
steps:
Expand Down Expand Up @@ -569,6 +589,7 @@ jobs:
# paths:
# - solana-programs/track_listen_count/target
# key: track-listen-count-deps-{{ checksum "solana-programs/track_listen_count/Cargo.toml" }}

test-solana-programs-anchor:
resource_class: large # 4vcpu/8gb
machine:
Expand Down Expand Up @@ -637,6 +658,9 @@ jobs:
parameters:
repo:
type: string
logspout-tag:
type: string
default: ""
steps:
- checkout
- setup_remote_docker:
Expand All @@ -645,10 +669,11 @@ jobs:
name: Get tag or latest
command: |
# order of precendence for IMAGE tag is:
# 1. CIRCLE_TAG if defined,
# 2. Branch name if 'hotfix' in branch name (branch name passed in via $CIRCLE_BRANCH)
# 3. 'latest', which is the default
echo "export IMAGE_TAG=`[ $CIRCLE_TAG ] && echo $(echo $CIRCLE_TAG | cut -d@ -f3) || [[ "$CIRCLE_BRANCH" =~ (hotfix) ]] && echo $CIRCLE_BRANCH || echo "latest" `" | tee -a $BASH_ENV
# 1. $(head -n1 logging/logspout/Dockerfile) if << parameters.logspout-tag >> defined,
# 2. CIRCLE_TAG if defined,
# 3. Branch name if 'hotfix' in branch name (branch name passed in via $CIRCLE_BRANCH)
# 4. 'latest', which is the default
echo "export IMAGE_TAG=`[ << parameters.logspout-tag >> ] && echo $(head -n1 logspout/Dockerfile | cut -f 2 -d ':') || [ $CIRCLE_TAG ] && echo $(echo $CIRCLE_TAG | cut -d@ -f3) || [[ "$CIRCLE_BRANCH" =~ (hotfix) ]] && echo $CIRCLE_BRANCH || echo "latest" `" | tee -a $BASH_ENV
- run:
name: Docker login
command: |
Expand All @@ -657,7 +682,8 @@ jobs:
name: Docker build << parameters.repo >>
command: |
cd << parameters.repo >>
docker build -t audius/<< parameters.repo >>:$IMAGE_TAG -t audius/<< parameters.repo>>:$(git rev-parse HEAD) --build-arg git_sha=$(git rev-parse HEAD) --build-arg audius_loggly_disable=$audius_loggly_disable --build-arg audius_loggly_token=$audius_loggly_token --build-arg audius_loggly_tags=$audius_loggly_tags --build-arg BUILD_NUM=$CIRCLE_BUILD_NUM .
audius_loggly_token_b64=$(echo ${audius_loggly_token} | base64)
docker build -t audius/<< parameters.repo >>:$IMAGE_TAG -t audius/<< parameters.repo>>:$(git rev-parse HEAD) --build-arg git_sha=$(git rev-parse HEAD) --build-arg audius_loggly_disable=$audius_loggly_disable --build-arg audius_loggly_token=$audius_loggly_token --build-arg audius_loggly_tags=$audius_loggly_tags --build-arg BUILD_NUM=$CIRCLE_BUILD_NUM --build-arg audius_loggly_token=$audius_loggly_token_b64 .
docker image prune --filter label=prune=true --filter label=build=$CIRCLE_BUILD_NUM --force
- run:
name: Docker push << parameters.repo >>
Expand Down Expand Up @@ -742,6 +768,15 @@ workflows:
context:
- GCP2
mad-dog-type: test

# in order to run a job in hold-workflows
# 1. go to the CircleCI dashboard
# 2. go to your branch of choice
# 3. click "Trigger Pipeline"
# 4. Add boolean paramter "full_ci" and set to true
hold-workflows:
when: << pipeline.parameters.full_ci >>
jobs:
- hold-test-mad-dog-e2e-full:
type: approval
- test-mad-dog-e2e:
Expand All @@ -751,6 +786,28 @@ workflows:
mad-dog-type: test-nightly
requires:
- hold-test-mad-dog-e2e-full
- hold-build-logspout:
type: approval
- docker-build-and-push:
name: build-logspout
repo: logspout
logspout-tag: "true"
requires:
- hold-build-logspout
- hold-bake-gcp-dev-image:
type: approval
filters:
branches:
only: /(^master$)/
- bake-gcp-dev-image:
context:
- GCP2
name: bake-gcp-dev-image
requires:
- hold-bake-gcp-dev-image
filters:
branches:
only: /(^master$)/

# test master at midnight daily
test-nightly:
Expand Down
16 changes: 12 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
### Description
<!--
What is the purpose of this PR?
What is the current behavior? New behavior?
Relevant links and/or information pertaining to PR?
-->

<!-- What is the purpose of this PR? What is the current behavior? New behavior? Relevant links and/or information pertaining to PR? -->

### Tests
<!--
List any automated test coverage added, if current automated tests are not sufficient.
List the manual tests and repro instructions to verify that this PR works as anticipated.
Include log analysis if possible.
If this change impacts clients, make sure that you have tested the clients!
-->

<!-- List the manual tests and repro instructions to verify that this PR works as anticipated. Include log analysis if possible. If this change impacts clients, make sure that you have tested the clients! -->

### How will this change be monitored? Are there sufficient logs?

### Monitoring - How will this change be monitored? Are there sufficient logs / alerts?
<!-- For features that are critical or could fail silently please describe the monitoring/alerting being added. -->


Expand Down
78 changes: 9 additions & 69 deletions api-client-generator/templates/typescript-fetch/apis.mustache
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* tslint:disable */
/* eslint-disable */
{{>licenseInfo}}
Expand All @@ -20,6 +21,9 @@ import {
{{#allParams.0}}
export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request {
{{#allParams}}
/**
* {{description}}
*/
{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}};
{{/allParams}}
}
Expand Down Expand Up @@ -83,6 +87,7 @@ export class {{classname}} extends runtime.BaseAPI {
{{/withInterfaces}}
{{#operation}}
{{#returnType}}
/**
{{#notes}}
* {{&notes}}
Expand All @@ -91,7 +96,7 @@ export class {{classname}} extends runtime.BaseAPI {
* {{&summary}}
{{/summary}}
*/
async {{nickname}}Raw({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/allParams.0}}initOverrides?: RequestInit): Promise<runtime.ApiResponse<{{{returnType}}}{{^returnType}}void{{/returnType}}>> {
async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, {{/allParams.0}}initOverrides?: RequestInit): Promise<NonNullable<{{returnType}}["data"]>> {
{{#allParams}}
{{#required}}
if (requestParameters.{{paramName}} === null || requestParameters.{{paramName}} === undefined) {
Expand Down Expand Up @@ -251,7 +256,7 @@ export class {{classname}} extends runtime.BaseAPI {
{{/isArray}}
{{/formParams}}
{{/hasFormParams}}
const response = await this.request({
return this.request({
path: `{{{path}}}`{{#pathParams}}.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters.{{paramName}}))){{/pathParams}},
method: '{{httpMethod}}',
headers: headerParameters,
Expand Down Expand Up @@ -284,75 +289,10 @@ export class {{classname}} extends runtime.BaseAPI {
{{#hasFormParams}}
body: formParams,
{{/hasFormParams}}
}, initOverrides);
{{#returnType}}
{{#isResponseFile}}
return new runtime.BlobApiResponse(response);
{{/isResponseFile}}
{{^isResponseFile}}
{{#returnTypeIsPrimitive}}
{{#isMap}}
return new runtime.JSONApiResponse<any>(response);
{{/isMap}}
{{#isArray}}
return new runtime.JSONApiResponse<any>(response);
{{/isArray}}
{{#returnSimpleType}}
return new runtime.TextApiResponse(response) as any;
{{/returnSimpleType}}
{{/returnTypeIsPrimitive}}
{{^returnTypeIsPrimitive}}
{{#isArray}}
return new runtime.JSONApiResponse(response{{^withoutRuntimeChecks}}, (jsonValue) => {{#uniqueItems}}new Set({{/uniqueItems}}jsonValue.map({{returnBaseType}}FromJSON){{/withoutRuntimeChecks}}){{#uniqueItems}}){{/uniqueItems}};
{{/isArray}}
{{^isArray}}
{{#isMap}}
return new runtime.JSONApiResponse(response{{^withoutRuntimeChecks}}, (jsonValue) => runtime.mapValues(jsonValue, {{returnBaseType}}FromJSON){{/withoutRuntimeChecks}});
{{/isMap}}
{{^isMap}}
return new runtime.JSONApiResponse(response{{^withoutRuntimeChecks}}, (jsonValue) => {{returnBaseType}}FromJSON(jsonValue){{/withoutRuntimeChecks}});
{{/isMap}}
{{/isArray}}
{{/returnTypeIsPrimitive}}
{{/isResponseFile}}
{{/returnType}}
{{^returnType}}
return new runtime.VoidApiResponse(response);
{{/returnType}}
}
/**
{{#notes}}
* {{&notes}}
{{/notes}}
{{#summary}}
* {{&summary}}
{{/summary}}
*/
{{^useSingleRequestParameter}}
async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> {
{{#returnType}}
const response = await this.{{nickname}}Raw({{#allParams.0}}{ {{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }, {{/allParams.0}}initOverrides);
return await response.value();
{{/returnType}}
{{^returnType}}
await this.{{nickname}}Raw({{#allParams.0}}{ {{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }, {{/allParams.0}}initOverrides);
{{/returnType}}
}
{{/useSingleRequestParameter}}
{{#useSingleRequestParameter}}
async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, {{/allParams.0}}initOverrides?: RequestInit): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> {
{{#returnType}}
const response = await this.{{nickname}}Raw({{#allParams.0}}requestParameters, {{/allParams.0}}initOverrides);
return await response.value();
{{/returnType}}
{{^returnType}}
await this.{{nickname}}Raw({{#allParams.0}}requestParameters, {{/allParams.0}}initOverrides);
{{/returnType}}
}, initOverrides) as Promise<NonNullable<{{returnType}}["data"]>>;
}
{{/useSingleRequestParameter}}
{{/returnType}}
{{/operation}}
}
{{/operations}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* tslint:disable */
/* eslint-disable */
{{>licenseInfo}}
Expand Down
Loading

0 comments on commit 054316a

Please sign in to comment.