├── docroot ├── .placeholder ├── onboarding │ └── private-cloud │ │ ├── 099.slide │ │ ├── 199.slide │ │ ├── 299.slide │ │ ├── .title │ │ ├── 250-make.slide │ │ ├── 120-python-sdk.slide │ │ ├── 270-scheduler.slide │ │ ├── 265-handlers.slide │ │ ├── 040-code.slide │ │ ├── 060-venv_finder.slide │ │ ├── 010-domain.slide │ │ ├── 000-who-am-i.slide │ │ ├── 140-unit-tests.slide │ │ ├── 110-ide.slide │ │ ├── 030-minio.slide │ │ ├── 240-sanity.slide │ │ ├── 210-torero.slide │ │ ├── 290-jenkins.slide │ │ ├── 130-debugger.slide │ │ ├── 070-pip.slide │ │ ├── 090-private-cloud-validate.slide │ │ ├── 225-scalability.slide │ │ ├── 080-private-cloud-config.slide │ │ ├── 020-bza-billing.slide │ │ ├── 150-opl.slide │ │ ├── 230-clients.slide │ │ ├── 260-captures.slide │ │ ├── 290-installer.slide │ │ ├── 280-deployment.slide │ │ ├── 220-secrets-mappings.slide │ │ └── 050-python-virtual-env.slide ├── rundebug_bar.png └── python_debugger.png ├── .gitignore ├── Dockerfile ├── LICENSE ├── bin ├── sfx.sh ├── present_patch └── presenter ├── README.md └── Makefile /docroot/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | sfx.run 2 | venv/ 3 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/099.slide: -------------------------------------------------------------------------------- 1 | ## Questions or break 2 | 3 | - `...` 4 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/199.slide: -------------------------------------------------------------------------------- 1 | ## Questions or break 2 | 3 | - `...` 4 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/299.slide: -------------------------------------------------------------------------------- 1 | ## Questions or break 2 | 3 | - `...` 4 | -------------------------------------------------------------------------------- /docroot/rundebug_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazemeter/presenter/master/docroot/rundebug_bar.png -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/.title: -------------------------------------------------------------------------------- 1 | # Private Cloud Fast Track 2 | 3 | Daniel Berstein 4 | April 2020 5 | -------------------------------------------------------------------------------- /docroot/python_debugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blazemeter/presenter/master/docroot/python_debugger.png -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/250-make.slide: -------------------------------------------------------------------------------- 1 | ## Make 2 | 3 | - `make lint` ([flake8](https://pypi.org/project/flake8)) 4 | - `make test` ([pytest](https://pypi.org/project/pytest)) 5 | - `make lest` = lint + test 6 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/120-python-sdk.slide: -------------------------------------------------------------------------------- 1 | ## Python SDK 2 | 3 | - `Command` + `;` 4 | - `Project SDK`, `New ...` 5 | - `Python SDK`, `Existing environment`, Location: 6 | 7 | ``` 8 | ~/repos/private-cloud/venv/bin/python 9 | ``` 10 | - `OK`, `Apply`, `OK` 11 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/270-scheduler.slide: -------------------------------------------------------------------------------- 1 | ## Scheduler 2 | 3 | [README](https://github.com/Blazemeter/private-cloud#scheduler) 4 | 5 | - Uses BZA's scheduler plus `bzm-app` scheduler 6 | - Guarantee that behind firewall schedules match cloud's schedule 7 | - Requires API key to be configured 8 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/265-handlers.slide: -------------------------------------------------------------------------------- 1 | ## Hooks & Handlers 2 | 3 | - Hooks 4 | - Blueprints 5 | - Handlers 6 | - Router 7 | - Base classes 8 | - RestHandler 9 | - Methods `Get`, `Post` ... 10 | - `BzmHandler`, `MockHandler`, `AuthHandler` ... 11 | - Concrete: `bzm.*`, `mock.*`, `auth.*` ... 12 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/040-code.slide: -------------------------------------------------------------------------------- 1 | ## Code 2 | 3 | - [Git](https://git-scm.com) (ie. from [brew](https://brew.sh)) 4 | 5 | ``` 6 | $ brew install git 7 | ``` 8 | --- 9 | ``` 10 | $ mkdir -p ~/repos && cd ~/repos \ 11 | && git clone git@github.com:Blazemeter/private-cloud.git \ 12 | && cd private-cloud 13 | ``` 14 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/060-venv_finder.slide: -------------------------------------------------------------------------------- 1 | ## venv_finder & venv usage 2 | 3 | - List virtual envs: 4 | 5 | ``` 6 | $ venv_finder 7 | ``` 8 | - Activate first: 9 | 10 | ``` 11 | $ venv 12 | ``` 13 | - Activate nth: 14 | 15 | ``` 16 | $ venv $N 17 | ``` 18 | - Deactivate: 19 | 20 | ``` 21 | $ deactivate 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/010-domain.slide: -------------------------------------------------------------------------------- 1 | ## Domain 2 | 3 | (for Private Cloud) 4 | 5 | - To reach `bzm-app` (and local Minio) 6 | - Reachable from: 7 | - `bzm-app` 8 | - `crane` 9 | - load engines 10 | - Create "fake" domain **pc.local** 11 | 12 | ``` 13 | $ echo $(ifconfig en0 | awk '/inet / {print $2}') pc.local | sudo tee -a /etc/hosts 14 | ``` 15 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/000-who-am-i.slide: -------------------------------------------------------------------------------- 1 | ## Who am I 2 | 3 | .image /static/broadcom-logo.png 4 | - Daniel Berstein 5 | - Since 2017 been Software Engineer at BlazeMeter 6 | - [Slack](https://blazemeter.slack.com) @daniel.berstein 7 | - [daniel.berstein@blazemeter.com](mailto:daniel.berstein@blazemeter.com), [danielbenjamin.berstein@broadcom.com](mailto:danielbenjamin.berstein@broadcom.com) 8 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/140-unit-tests.slide: -------------------------------------------------------------------------------- 1 | ## Unit Tests 2 | 3 | - `EnvFile` **`ut.env`**, `Tests`: `[+]` choose **`ut.env`** `[Apply]`, `[OK]` 4 | - `Mark Directory as` (file tree right-click directories) 5 | - **Sources Root** 6 | - `app` 7 | - `bzm_app` 8 | - `private_cloud` 9 | - **Test Sources Root** 10 | - `tests` 11 | - **Excluded** 12 | - `venv` 13 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/110-ide.slide: -------------------------------------------------------------------------------- 1 | ## IDE 2 | 3 | - [IntelliJ IDEA](https://www.jetbrains.com/idea/) 4 | - Install [Python Plugin](https://www.jetbrains.com/help/idea/plugin-overview.html) 5 | - Configure [Python Debugger](https://www.jetbrains.com/help/idea/debugger-python.html) **with** `Gevent compatible` selected 6 | - Open directory `~/repos/private-cloud`, Python project 7 | 8 | .image /python_debugger.png 300 _ 9 | 10 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/030-minio.slide: -------------------------------------------------------------------------------- 1 | ## Minio 2 | 3 | - [Minio](https://github.com/minio/minio) listen at: 4 | 5 | ``` 6 | http://pc.local:9000 7 | ``` 8 | - Brew or use [installer](https://github.com/Blazemeter/private-cloud/blob/master/install/docker/install.sh): 9 | 10 | ``` 11 | brew install minio 12 | ``` 13 | - Create `bucket` (installer does it [automatically](https://github.com/Blazemeter/private-cloud/blob/master/install/docker/install.sh#L280)): 14 | 15 | ``` 16 | blazemeter 17 | ``` 18 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/240-sanity.slide: -------------------------------------------------------------------------------- 1 | ## Sanity 2 | 3 | Sanity [checks](https://github.com/Blazemeter/private-cloud/tree/master/bzm_app/sanity) 4 | 5 | - Write to S3 type and results 6 | - [Boot](https://github.com/Blazemeter/private-cloud/blob/master/private_cloud/__main__.py#L21) 7 | - [API](https://github.com/Blazemeter/private-cloud/blob/990ec0b8def43b4bea67721c05e46d1323207e44/private_cloud/handler/bzm/health.py#L10) 8 | - [Quick](https://github.com/Blazemeter/private-cloud/blob/master/private_cloud/__main__.py#L16) S3 connectivity test with `BZM_CHECK_S3` 9 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/210-torero.slide: -------------------------------------------------------------------------------- 1 | ## Torero 2 | 3 | - BZA needs access to metadata (localtions, threads, etc) 4 | - Not available when PrivateCloud! 5 | - Torero is [CraneComponent](https://github.com/Blazemeter/a.blazemeter.com/tree/develop/src/blazemeter/Controller/CraneComponents) for [Crane](https://github.com/Blazemeter/bzm-crane) 6 | - **Reads** from S3 and **writes** result; **both** via **`bzm-app`** 7 | - PrivateCloud inspects for [CraneComponent](https://github.com/Blazemeter/private-cloud/blob/master/bzm_app/codec/crane.py) to ease encode/decode 8 | - Not all Crane payloads are CraneComponents 9 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/290-jenkins.slide: -------------------------------------------------------------------------------- 1 | ## Jenkins 2 | 3 | - Testers 4 | - [API-TEST-BZA](http://new-jenkins.blazemeter.com:8080/job/API-TEST-BZA/) 5 | - [API-TEST-TAURUS](http://new-jenkins.blazemeter.com:8080/job/API-TEST-TAURUS/) 6 | - [API-TEST-SELECTED](http://new-jenkins.blazemeter.com:8080/job/API-TEST-SELECTED/) 7 | - Builders 8 | - [CRANE-BZM-APP-CI](http://new-jenkins.blazemeter.com:8080/job/CRANE-BZM-APP-CI/) 9 | - [CRANE-BZM-CRANE](http://new-jenkins.blazemeter.com:8080/job/CRANE-BZM-CRANE/) 10 | - [CRANE-TORERO-CI](http://new-jenkins.blazemeter.com:8080/job/CRANE-TORERO-CI/) 11 | - ... 12 | - BZA's harborVersionSettings 13 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/130-debugger.slide: -------------------------------------------------------------------------------- 1 | ## Debugger 2 | 3 | - `Run/Debug Add Configuration` 4 | - `Add configuration` `Templates` > (`Python` | `Python tests` > `pytest`) 5 | - `EnvFile` > `Enable EnvFile` 6 | - `[+]` .env file choose **`.env`** 7 | - Choose another file then "edit" path 8 | - `[+]` `Script path` >> `Module name`: `private_cloud`. `[Apply]`, `[OK]` 9 | - `[Apply]`, `[OK]` 10 | 11 | .image /rundebug_bar.png 140 _ 12 | 13 | ## Debugger validation 14 | 15 | - **Run** or **Debug** with **breakpoint** at [favicon](https://github.com/Blazemeter/private-cloud/blob/master/private_cloud/handler/bzm/static.py#L32) handler 16 | - `curl -i http://pc.local:5000/favicon.ico` 17 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/070-pip.slide: -------------------------------------------------------------------------------- 1 | ## pip and requirements 2 | 3 | - Ensure using correct **venv**: 4 | 5 | ``` 6 | $ which python | grep $(basename $(pwd)) # should output path to venv's python 7 | ``` 8 | - Install requirements in venv: 9 | 10 | ``` 11 | $ pip install -r requirements/builder.txt && pip install -r requirements/dev.txt 12 | ``` 13 | 14 | - Install application in dev mode: 15 | 16 | ``` 17 | $ pip install -e . 18 | ``` 19 | - Private Cloud should start (inside venv) ... 20 | 21 | ``` 22 | $ private-cloud 23 | * APPLICATION_URL: [https://a.blazemeter.com] 24 | * DATA_SERVICE_URL: [https://data.blazemeter.com] 25 | ... 26 | CTRL-C 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/090-private-cloud-validate.slide: -------------------------------------------------------------------------------- 1 | ## Validate configuration 2 | 3 | - Check it runs (inside venv) ... 4 | 5 | ``` 6 | $ env $(cat .env) private-cloud 7 | * APPLICATION_URL: [https://bza-{bzdev env}.blazemeter.net] 8 | * DATA_SERVICE_URL: [https://bza-{bzdev env}.blazemeter.net] 9 | ... ~15s for sanity checks to finish ... 10 | ``` 11 | - Open browser at: 12 | ``` 13 | http://pc.local:5000 14 | ``` 15 | - **Welcome to private cloud!** 16 | - `CTRL-C` 17 | 18 | See [README](https://github.com/Blazemeter/private-cloud#configuration) and [Data Router Configuration Variables](https://blazemeter.atlassian.net/wiki/spaces/BIKB/pages/847904965/Data+Router+Configuration+Variables) 19 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/225-scalability.slide: -------------------------------------------------------------------------------- 1 | ## Scalability 2 | 3 | - Concurrency management or why I do not scale 4 | - Local file [locking](https://github.com/Blazemeter/private-cloud/blob/master/bzm_app/mapping.py#L96) to not lose secrets on single node 5 | - Reads mapping adds secret: 6 | 7 | ``` 8 | M={S1} => M={S1,S2} 9 | ``` 10 | - Another node does same: 11 | 12 | ``` 13 | M'={S1} => M'={S1,S2'} 14 | ``` 15 | - Whichever node writes first/last either `S2` or `S2'` are **lost**! 16 | - Fine-grained `namespaces` may have with less **concurrent** APIs need to write to same mapping 17 | - Be small, be fast 18 | - LB with session affinity may not help 19 | - Mappings used by API? 20 | - Slow process: re-read and `merge` 21 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/080-private-cloud-config.slide: -------------------------------------------------------------------------------- 1 | ## Private Cloud Configuration 2 | 3 | - `minio`: `http://pc.local:9000` 4 | - `bzm-app`: `http://pc.local:5000` 5 | - `.env`: 6 | 7 | ``` 8 | cat < .env 9 | ACCOUNT_ID={PrivateCloud account ID} 10 | GATEWAY_PORT=5000 11 | APPLICATION_URL=https://bza-{bzdev env}.blazemeter.net 12 | DATA_SERVICE_URL=https://bza-{bzdev env}.blazemeter.net 13 | AUTH_SERVICE_URL=https://keycloak-{bzdev env}.blazemeter.net 14 | 15 | ENDPOINT_URL=http://pc.local:9000 16 | BUCKET=blazemeter 17 | ACCESS_KEY_ID={Minio username} 18 | SECRET_ACCESS_KEY={Minio password} 19 | SIGNATURE=s3v4 20 | EOS 21 | ``` 22 | - Installer's Minio credentials can be found at: 23 | 24 | ``` 25 | /opt/storage/bzm-storage/.minio.sys/config/config.json 26 | ``` 27 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/020-bza-billing.slide: -------------------------------------------------------------------------------- 1 | ## BZA & Billing 2 | 3 | - Working [bzdev](https://github.com/Blazemeter/bzdev#install) installation 4 | - Round 1 ([How to give yourself admin on billing](https://blazemeter.atlassian.net/wiki/spaces/RD/pages/571801667/How+to+give+yourself+admin+on+billing)) 5 | - @Billing create PrivateCloud Plan at (`PrivateCloud=true`): 6 | 7 | ``` 8 | https://billing-{bzdev env}.blazemeter.net 9 | ``` 10 | - @BZA create new user using `REGISTER` tab at: 11 | 12 | ``` 13 | https://bza-{bzdev env}.blazemeter.net/app/sign-in 14 | ``` 15 | - Round 2 16 | - @Billing add to **created user** Plan with PrivateCloud 17 | - @BZA set **Application Url** (installer does it automatically) to `http://pc.local:5000` at 18 | 19 | ``` 20 | https://bza-{bzdev env}.blazemeter.net/app/#/settings/accounts/{PrivateCloud account ID}/environment 21 | ``` 22 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/150-opl.slide: -------------------------------------------------------------------------------- 1 | ## Private Cloud OPLs 2 | 3 | - At least one required for [Torero](https://github.com/Blazemeter/torero) 4 | - Docker for Mac: screen into [VM](https://gist.github.com/BretFisher/5e1a0c7bcca4c735e716abf62afad389#option-1-use-screen-not-as-easy-as-nsenter) 5 | 6 | ``` 7 | $ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty 8 | ``` 9 | - As **PrivateCloud** user create `shared` harbor with 10 slots and ship 10 | - `A_ENVIRONMENT` **must** be `http://pc.local:5000` 11 | 12 | ``` 13 | $ docker logs -f $(docker run ...) 14 | ``` 15 | - Take coffee, wait **until** ship has status `idle` at 16 | 17 | ``` 18 | http://pc.local:5000/app/#/settings/accounts/{accountID}/workspaces/{workspaceID}/private-locations/ 19 | ``` 20 | - Run BlazeMeter Test 21 | - `Performance` tab `>` `[Create Test]` `>` `[Performance Test]` 22 | - URL/API: `http://blazedemo.com` 23 | - JMX, YAML, ... 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG GO_VERSION=1.14.1 2 | ARG ALPINE_VERSION=3.11 3 | 4 | FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder 5 | ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 6 | RUN apk add --no-cache build-base musl-dev git upx \ 7 | && go get golang.org/x/tools/cmd/present 8 | COPY ./bin/present_patch /usr/local/bin/ 9 | RUN present_patch \ 10 | && echo "Building [golang.org/x/tools/cmd/present] ..." >&2 \ 11 | && go build -a -tags netgo -ldflags '-w -extldflags "-static"' golang.org/x/tools/cmd/present \ 12 | && upx /go/bin/present 13 | 14 | FROM alpine:${ALPINE_VERSION} AS presenter 15 | COPY --from=builder /go/bin/present /usr/local/bin/present 16 | WORKDIR /present/static 17 | COPY --from=builder /go/src/golang.org/x/tools/cmd/present/static/ ./ 18 | WORKDIR /present/templates 19 | COPY --from=builder /go/src/golang.org/x/tools/cmd/present/templates/ ./ 20 | WORKDIR /present/docroot 21 | COPY ./docroot/ ./ 22 | COPY ./bin/presenter /usr/local/bin/ 23 | RUN ln -s /usr/local/bin/presenter /usr/local/bin/presenter.shared 24 | CMD ["presenter"] 25 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/230-clients.slide: -------------------------------------------------------------------------------- 1 | ## Clients 2 | 3 | More than one backend 4 | 5 | - `/auth/...` uses [client](https://github.com/Blazemeter/private-cloud/blob/master/private_cloud/client/__init__.py) for [auth`/...`](https://github.com/Blazemeter/private-cloud/blob/master/bzm_app/config.py#L59) 6 | - `/mock/...` uses [client](https://github.com/Blazemeter/private-cloud/blob/master/private_cloud/client/__init__.py#L306) for [mock`/...`](https://github.com/Blazemeter/private-cloud/blob/master/bzm_app/config.py#L72) 7 | 8 | - Mock services ([https://mock.blazemeter.com](https://mock.blazemeter.com)) 9 | - Keycloak ([https://auth.blazemeter.com](https://auth.blazemeter.com)) 10 | - Currently Keycloak SSO cannot not work with legacy and new SSO mechanisms 11 | - SAML issue of identity provider; `bzm-app` is not BZA 12 | - No Private Cloud customers on KeyCloak 13 | - Using legacy SAML 14 | 15 | : auth has routes under /auth and / use [client_for](https://github.com/Blazemeter/private-cloud/blob/master/private_cloud/handler/__init__.py#L37) 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Daniel Berstein 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/260-captures.slide: -------------------------------------------------------------------------------- 1 | ## Captures 2 | 3 | See [README](https://github.com/Blazemeter/private-cloud#capture-traffic-fixtures-development) 4 | 5 | - If behavior **correct**, commit as UT (for anti-regressions: same input, same output) 6 | - Fixtures per [method/path](https://github.com/Blazemeter/private-cloud/tree/master/tests/fixtures/captured) 7 | - Not perfect, cannot predict changes in backend 8 | - Commit only relevant captures 9 | 10 | ## Capture k8s, docker 11 | 12 | - Kubernetes 13 | 14 | ``` 15 | REQUEST_DUMP_CAPTURE_DIR=/tmp 16 | $ kubectl cp \ 17 | ns-*/dpl-generic-private-cloud-*:${REQUEST_DUMP_CAPTURE_DIR}/ \ 18 | ./tests/fixtures/captured/ 19 | ... 20 | ``` 21 | 22 | - Docker 23 | 24 | ``` 25 | $ echo REQUEST_DUMP_CAPTURE_DIR=$(pwd)/tests/fixtures/captured >> .env 26 | $ env $(cat .env) private-cloud 27 | ... 28 | ``` 29 | 30 | - Test, commmit and push 31 | 32 | ``` 33 | $ git add ./tests/fixtures/captured///*.json 34 | ... 35 | $ make lest 36 | ... 37 | $ git commit -m ... && make lest && git push 38 | ``` 39 | 40 | : new-pc 41 | : api testing 42 | : scheduler 43 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/290-installer.slide: -------------------------------------------------------------------------------- 1 | ## Installer 2 | 3 | Installer [code](https://github.com/Blazemeter/private-cloud/blob/master/install/docker/install.sh), [wiki](https://blazemeter.atlassian.net/wiki/spaces/RD/pages/736919787/Private+Cloud+Docker+installer+WAP-14064) 4 | 5 | - [Private Cloud Installation Guide](https://github.com/Blazemeter/private-cloud/tree/master/install/docker#private-cloud-installation-guide-for-docker) 6 | - [Jenkinsfile](https://github.com/Blazemeter/private-cloud/blob/master/Jenkinsfile#L17) builds and uploads to S3 [installer](https://s3.amazonaws.com/blazemeter-images/bzm-app/install/docker/install.run) 7 | - Upon installation account's **bzmAppImageUrl** determines the image of `bzm-app` to install 8 | - Default image from [HarborVersionSettings](https://github.com/Blazemeter/a.blazemeter.com/blob/develop/src/blazemeter/Settings/HarborVersionsSettings.php#L274) 9 | 10 | Installer creates: 11 | 12 | - Configurations: `/etc/blazemeter/PrivateCloud/.env` 13 | - Certificates: `/etc/blazemeter/PrivateCloud/certs/*` (mount: `docker run ... -v /etc/blazemeter/PrivateCloud/certs:/usr/src/app/certs`) 14 | - Start application script: `/usr/local/blazemeter/PrivateCloud/bzm-data-router` 15 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/280-deployment.slide: -------------------------------------------------------------------------------- 1 | ## Deployment 2 | 3 | - Module [private_cloud](https://github.com/Blazemeter/private-cloud/blob/master/private_cloud/__main__.py) main 4 | - [private-cloud](https://github.com/Blazemeter/private-cloud/blob/master/setup.py#L18) 5 | - [backwards](https://github.com/Blazemeter/private-cloud/blob/master/Dockerfile#L57) [compatible](https://github.com/Blazemeter/private-cloud/blob/master/app/entrypoint.sh) 6 | - Dockerfile [patches](https://github.com/Blazemeter/private-cloud/tree/master/patches) 7 | - Not a crane component (crane's installation requires working `bzm-app`): no auto update 8 | - Jenkins [builder](http://new-jenkins.blazemeter.com:8080/job/CRANE-BZM-APP-CI/) job 9 | - Build from [master](http://new-jenkins.blazemeter.com:8080/job/CRANE-BZM-APP-CI/job/master/) after merging 10 | - Update BZA's [HarborVersionSettings](https://github.com/Blazemeter/a.blazemeter.com/blob/develop/src/blazemeter/Settings/HarborVersionsSettings.php#L270): [prod](https://a.blazemeter.com/api/v4/admin/phpinfo#cranecomponents_settings), [new](https://new.blazemeter.com/api/v4/admin/phpinfo#cranecomponents_settings), etc 11 | - CSM informs updated URL for customers to update at their convenience 12 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/220-secrets-mappings.slide: -------------------------------------------------------------------------------- 1 | ## Secrets & Mappings 2 | 3 | - Secrets **stored** in customer's S3-compatible storage 4 | - S3 files `(err.)keys(.apm*)` 5 | - [Codec](https://github.com/Blazemeter/private-cloud/tree/master/bzm_app/codec) hashes secret with user provided [ENCODE_HASH_SALT](https://github.com/Blazemeter/private-cloud/blob/a9596f6a9e5529e2e089d582c1abaae044b3d63e/bzm_app/config.py#L153) 6 | - Optional, sane default: `ACCOUNT_ID` 7 | - Salt change **does not** affect decode! 8 | - [Mappings](https://github.com/Blazemeter/private-cloud/blob/master/bzm_app/mapping.py#L259) abstracts secret files access 9 | - [Hooks](https://github.com/Blazemeter/private-cloud/tree/master/app/bzm_gateway_interceptor/hooks), [handlers](https://github.com/Blazemeter/private-cloud/tree/master/private_cloud/handler) 10 | - **Which** Mappings involved (ie. paths) 11 | - **When**, **[what](https://github.com/Blazemeter/private-cloud/blob/master/app/bzm_gateway_interceptor/blazemeter/client.py#L24)** to encode or decode 12 | - When adding secrets **always** use context manager `with Mapping(...) as m:` 13 | - Convenience method [merge](https://github.com/Blazemeter/private-cloud/blob/master/bzm_app/mapping.py#L230) allows to gather secrets from several keys files 14 | 15 | : Dictionary 16 | -------------------------------------------------------------------------------- /docroot/onboarding/private-cloud/050-python-virtual-env.slide: -------------------------------------------------------------------------------- 1 | ## Python virtual environment 2 | 3 | - Create virtual environment 4 | 5 | ``` 6 | $ python3 -m venv ./ 7 | ``` 8 | - Install venv_finder/venv (easier than [this](https://blazemeter.atlassian.net/wiki/spaces/RD/pages/102199061/How+to+enter+a+Python+virtual+environment)) 9 | 10 | ``` 11 | $ INIT_FILES=$(find ~ -maxdepth 1 -type f \( -name .profile -o -name .zshrc -o -name .bash_profile -o -name .bashrc \)) \ 12 | && cat <&2 Try: $(echo_bold "env PRESENTER_CMD=$PRESENTER_CMD PRESENTER_PORT=$(echo $PRESENTER_PORT+1 | bc) sh $0") \ 23 | && exit 1; 24 | } 25 | 26 | container_cleanup() { 27 | echo -e "\nCommand to remove imported image:\n$(tput bold)$PRESENTER_CMD rmi -f $1$(tput sgr0)\n" 28 | } 29 | 30 | container_opener() { 31 | $PRESENTER_OPENER http://${PRESENTER_HOST}:${PRESENTER_PORT} 32 | } 33 | 34 | [ -z $(command -v $PRESENTER_OPENER) ] && PRESENTER_OPENER=open 35 | [ -z $(command -v "$PRESENTER_CMD") ] && { echo_bold "Command not found:" $PRESENTER_CMD && exit 1; } 36 | IMAGE="$(tail -n +$(offset) $0 | $PRESENTER_CMD import --change "CMD presenter.shared" --message "created by https://github.com/dberstein/presenter at $(date)" -)" \ 37 | && [ -n $IMAGE ] && CONTAINER=$(container_run $IMAGE || image_error $IMAGE) \ 38 | && [ -n $CONTAINER ] && container_cleanup $IMAGE && container_opener 39 | exit 0 40 | # NOTE: Don't place any newline characters after the last line below 41 | #__TARFILE_FOLLOWS__ 42 | -------------------------------------------------------------------------------- /bin/present_patch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Do here modifications to content under $ROOT, before "present" is compiled 4 | ROOT=$(go env GOPATH)/src/golang.org/x/tools/cmd/present 5 | echo "Patching [$ROOT] ..." >&2 \ 6 | && echo remove topbar >&2 \ 7 | && sed -i'' '/
/,/<\/div><\/div>/d' $ROOT/templates/dir.tmpl \ 8 | && echo ... change title >&2 \ 9 | && sed -i'' 's/Talks - The Go Programming Language/Talks/g' $ROOT/templates/dir.tmpl \ 10 | && echo ... change subtitle >&2 \ 11 | && sed -i'' 's/Go talks/Talks<\/a>/g' $ROOT/templates/dir.tmpl \ 12 | && echo ... change slogan >&2 \ 13 | && sed -i'' 's/The Go Programming Language/Talks/g' $ROOT/templates/dir.tmpl \ 14 | && echo remove footer >&2 \ 15 | && sed -i'' '/