Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,12 @@ bosh-release: build/autoscaler-test.tgz_CI_true
# already there for `go-mod-tidy` to work. See additional comment for that target in
# ./src/autoscaler/Makefile.
build/autoscaler-test.tgz: build_all go-mod-tidy go-mod-vendor
@echo " - creating bosh release into build/autoscaler-test.tgz"; \
@bosh create-release --force --timestamp-version --tarball=build/autoscaler-test.tgz; \
@echo ' - creating bosh release into build/autoscaler-test.tgz'
@bosh create-release --force --timestamp-version --tarball='build/autoscaler-test.tgz'

build/autoscaler-test.tgz_CI_true: go-mod-tidy go-mod-vendor
@echo " - creating bosh release into ${AUTOSCALER_BOSH_TARBALL_PATH}"
@bosh create-release ${AUTOSCALER_BOSH_BUILD_OPTS} --version ${AUTOSCALER_BOSH_VERSION} --tarball=${AUTOSCALER_BOSH_TARBALL_PATH}
@echo ' - creating bosh release into ${AUTOSCALER_BOSH_TARBALL_PATH}'
@bosh create-release ${AUTOSCALER_BOSH_BUILD_OPTS} --version='${AUTOSCALER_BOSH_VERSION}' --tarball='${AUTOSCALER_BOSH_TARBALL_PATH}'

.PHONY: generate-fakes autoscaler.generate-fakes test-app.generate-fakes
generate-fakes: autoscaler.generate-fakes test-app.generate-fakes
Expand Down
648 changes: 324 additions & 324 deletions devbox.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jobs/golangapiserver/templates/apiserver.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ broker_credentials:
catalog_path: /var/vcap/jobs/golangapiserver/config/catalog.json
catalog_schema_path: /var/vcap/packages/golangapiserver/catalog.schema.json
info_file_path: /var/vcap/jobs/golangapiserver/config/info.json
policy_schema_path: /var/vcap/packages/golangapiserver/policy_json.schema.json
policy_schema_path: /var/vcap/packages/golangapiserver/scaling-policy.legacy-schema.json
dashboard_redirect_uri: <%= p("autoscaler.apiserver.broker.server.dashboard_redirect_uri") %>
default_credential_type: <%= p("autoscaler.apiserver.broker.default_credential_type") %>

Expand Down
6 changes: 3 additions & 3 deletions nix/flake.lock

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

21 changes: 9 additions & 12 deletions packages/golangapiserver/packaging
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOROOT=$(readlink --no-newline --canonicalize /var/vcap/packages/golang-1-linux)
export PATH="${GOROOT}/bin:${PATH}"
export GOPATH="${BOSH_COMPILE_TARGET}"
export GOCACHE=/tmp/gocache

pushd ${BOSH_COMPILE_TARGET}/autoscaler
pushd "${BOSH_COMPILE_TARGET}/autoscaler"
GOPROXY=off make build-api
popd

cp -a ${BOSH_COMPILE_TARGET}/autoscaler/build/api ${BOSH_INSTALL_TARGET}
cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/db/api.db.changelog.yml ${BOSH_INSTALL_TARGET}
cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/db/servicebroker.db.changelog.yaml ${BOSH_INSTALL_TARGET}

cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/policyvalidator/policy_json.schema.json ${BOSH_INSTALL_TARGET}
cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/schemas/catalog.schema.json ${BOSH_INSTALL_TARGET}


cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/build/api" "${BOSH_INSTALL_TARGET}"
cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/api/db/api.db.changelog.yml" "${BOSH_INSTALL_TARGET}"
cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/api/db/servicebroker.db.changelog.yaml" "${BOSH_INSTALL_TARGET}"

cp --archive "${BOSH_COMPILE_TARGET}"/autoscaler/api/policyvalidator/*.json "${BOSH_INSTALL_TARGET}"
cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/api/schemas/catalog.schema.json" "${BOSH_INSTALL_TARGET}"
2 changes: 1 addition & 1 deletion schema/api/policy-api.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ components:
type: string
example: Asia/Shanghai
# TODO: Try to make use of <https://stackoverflow.com/a/71121905>
#- $ref: "../../src/autoscaler/api/policyvalidator/policy_json.schema.json#/" # TODO:
#- $ref: "../../src/autoscaler/schema/api/policyvalidator/policy_json.schema.json#/" # TODO:
recurring_schedule:
type: array
items:
Expand Down
7 changes: 7 additions & 0 deletions schema/json/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Read-me #

The currently used golang-library for json-schema, namely “[gojsonschema](<https://github.com/xeipuuv/gojsonschema>)” not seems to be capable to resolve references to other files correctly across different directories. Perhaps not limited to but especially when referencing up the file-system-hierarchy (parent-directories). In theory, symbolic links can be used to circumvent the issue … if there would not be another weakness in <https://github.com/cloudfoundry/bosh-compile-action> which we currently use in the workflow [bosh-release-checks.yaml](<../../../../.github/workflows/bosh-release-checks.yaml>) for making a compiled release: It can not handle symbolic links. Therefore it gets hard-linked here (which can not be tracked by git but it can somehow handle it!).

After phasing out the bosh-technology of “Application Autoscaler”, these hardlinks can be removed.

⚠️ This means the consinstence needs to be ensured manually. There is no CI/CD-check because Bosh is already in its phase-out for “Application Autoscaler”.
17 changes: 17 additions & 0 deletions schema/json/app-scaling-configuration.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-05/schema#",
"title": "Binding-request-parameters-schema",
"description": "Schema for parameters for a service-binding creation with an instances of Application Autoscaler.",
"type": "object",

"properties": {
"binding-configuration": {
"$ref": "./binding-configuration.schema.json"
},
"scaling-policy": {
"$ref": "./scaling-policy.schema.json"
}
},

"additionalProperties": false
}
21 changes: 21 additions & 0 deletions schema/json/binding-configuration.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "http://json-schema.org/draft-05/schema#",
"title": "",
"description": "Schema for the configuration of service-bindings with instances of Application Autoscaler.",
"type": "object",

"properties": {
"app_guid": {
"$ref": "./shared_definitions.json#/schemas/guid"
},
"credential-type": {
"type": "string",
"enum": [
"x509",
"binding-secret"
]
}
},
"required": ["app_guid"],
"additionalProperties": false
}
40 changes: 40 additions & 0 deletions schema/json/policy-configuration.legacy-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "http://json-schema.org/draft-05/schema#",
"title": "",
"description": "Schema for a scaling-policy.",
"type": "object",

"properties": {
"custom_metrics": {
"type": "object",
"properties": {
"metric_submission_strategy": {
"type": "object",
"properties": {
"allow_from": {
"type": "string",
"enum": [
"bound_app",
"same_app"
]
}
},
"required": [
"allow_from"
]
}
},
"required": [
"metric_submission_strategy"
],
"additionalProperties": false
},
"app_guid": {
"$ref": "./shared_definitions.json#/schemas/guid"
}
},
"required": [
"custom_metrics"
],
"additionalProperties": false
}
43 changes: 43 additions & 0 deletions schema/json/policy-configuration.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-05/schema#",
"title": "",
"description": "Schema for a scaling-policy.",
"type": "object",

"properties": {
"configuration": {
"type": "object",
"properties": {
"custom_metrics": {
"type": "object",
"properties": {
"metric_submission_strategy": {
"type": "object",
"properties": {
"allow_from": {
"type": "string",
"enum": [
"bound_app",
"same_app"
]
}
},
"required": [
"allow_from"
]
}
},
"required": [
"metric_submission_strategy"
],
"additionalProperties": false
}
},
"required": [
"custom_metrics"
],
"additionalProperties": false
}
},
"additionalProperties": false
}
Loading
Loading