Skip to content

Commit 1adcda9

Browse files
authored
Tanzu Tile implementation and documentation (open-telemetry#2726)
Tanzu Tile implementation and docs This change implements the required code for creating the Tanzu Tile. The Tanzu Tile is a way to deploy the collector to get metrics from the Tanzu environment. In the tile directory, run the command ./make-latest-tile to generate the Tanzu tile. Refer to DEVELOPMENT.md to know how to properly use the created tile.
1 parent cf4c99b commit 1adcda9

File tree

22 files changed

+547
-75
lines changed

22 files changed

+547
-75
lines changed

.github/workflows/bosh-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
- name: Check out the codebase.
2626
uses: actions/checkout@v3
2727
- name: Set up Homebrew
28-
uses: Homebrew/actions/setup-homebrew@0c611abec1fc679030907286a2c084cc92fb8f2e
28+
id: set-up-homebrew
29+
uses: Homebrew/actions/setup-homebrew@251cc053a43110ce4dea3cdb6f038147c82d0257
2930
- name: Install BOSH CLI
3031
shell: bash
3132
run: |

.github/workflows/tanzu-tile.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Tanzu Tile
2+
3+
# The workflow triggered by any change in deployments/cloudfoundry/bosh/
4+
# or /deployments/cloudfoundry/tile
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- 'deployments/cloudfoundry/bosh/**'
10+
- 'deployments/cloudfoundry/tile/**'
11+
12+
permissions:
13+
contents: write
14+
15+
defaults:
16+
run:
17+
working-directory: 'deployments/cloudfoundry/tile'
18+
19+
jobs:
20+
21+
test:
22+
name: Test Tanzu Tile creation
23+
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
24+
runs-on: ubuntu-20.04
25+
steps:
26+
- name: Check out the codebase.
27+
uses: actions/checkout@v3
28+
- name: Set up Homebrew
29+
id: set-up-homebrew
30+
uses: Homebrew/actions/setup-homebrew@master
31+
- name: Install BOSH CLI
32+
shell: bash
33+
run: |
34+
brew install cloudfoundry/tap/bosh-cli
35+
bosh -v
36+
- name: Install PCF CLI
37+
shell: bash
38+
run: |
39+
pip install tile-generator
40+
- name: Run release script
41+
shell: bash
42+
run: |
43+
./make-latest-tile
44+
tanzu_tile_regex="product/splunk-otel-collector-*.pivotal"
45+
size="$(stat -c '%s' $tanzu_tile_regex)"
46+
if [[ $size -eq 0 ]]; then
47+
echo "File is empty!" >&2
48+
exit 1
49+
fi
50+
51+
tanzu_tile_path=$(pwd)/$tanzu_tile_regex
52+
echo "tanzu_tile_path=$tanzu_tile_path" >> $GITHUB_ENV
53+
54+
- name: Uploading artifacts
55+
uses: actions/upload-artifact@v3
56+
with:
57+
name: tanzu-tile-latest.pivotal
58+
path: ${{ env.tanzu_tile_path }}

deployments/cloudfoundry/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
# Splunk OpenTelemetry Collector Pivotal Cloud Foundry (PCF) Integrations
22

3+
Supported Tanzu Application Service (TAS) versions: v2
4+
5+
Unsupported TAS versions: v3
6+
37
### Cloud Foundry Buildpack
48

59
This integration can be used to install and run the Collector as a sidecar to your app.
610
In this configuration, the Collector will run in the same container as the app.
711

812
### Bosh Release
913

10-
This is a Bosh release of the Splunk Collector. This deploys the Collector to the PCF
11-
environment as a standalone deployment.
14+
This is a Bosh release of the Collector. This deploys the Collector to the PCF
15+
environment as a standalone deployment.
16+
17+
### Tanzu Tile
18+
19+
This is a Tanzu Tile of the Collector, which is a packaged release of the collector
20+
that can be integrated into the Ops Manager. The Tanzu Tile enables users to download, install,
21+
run, configure, and update the collector all from the Ops Manager.
22+
23+
[Tanzu Tile UI](./tile/resources/tanzu_tile_in_ops_mgr.png)
24+
25+
[Tanzu Tile Configuration UI](./tile/resources/tanzu_tile_config_options.png)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
latest-release.tgz
2-
signalfx-agent.tar.gz
32
splunk_otel_collector
43
.dev_builds
54
blobs
6-
dev_releases
5+
dev_releases
6+
bosh-env

deployments/cloudfoundry/bosh/DEVELOPMENT.md

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,65 @@
22

33
## Getting Started
44

5-
[Bosh Release Documentation (Overview)](https://bosh.io/docs/create-release/)
5+
### Start the BOSH Director
66

7-
[Quick Start Guide](https://bosh.io/docs/bosh-lite/)
7+
[Local machine prerequisites](https://bosh.io/docs/quick-start/#prerequisites)
8+
- The latest VirtualBox environment v7 is incompatible with this
9+
functionality. Downgrade VirtualBox to [v6](https://www.virtualbox.org/wiki/Download_Old_Builds_6_1) to
10+
ensure it can work. Tested successfully on `v6.1.42`
11+
12+
13+
Automated start process:
14+
```shell
15+
# Sets up BOSH Director locally
16+
make
17+
# Makes sure local shell gets proper credentials to access director
18+
source bosh-env/virtualbox/.envrc
19+
```
820

9-
### Supplementary Getting Started Checklist
21+
Manual start process:
22+
[Follow the quick start guide to run a BOSH Director.](https://bosh.io/docs/quick-start/)
1023

11-
- Make sure director is running
12-
- Quick start guide to run a BOSH Director can be found [here.](https://bosh.io/docs/quick-start/)
13-
- Need to upload right Ubuntu/OS blob
14-
- Guide can be found [here.](https://bosh.io/docs/uploading-stemcells/)
15-
- The following is an example command to upload the Warden (BOSH Lite) Ubuntu Bionic (18.04.6 LTS) stemcell:
24+
Common Errors:
25+
- "Waiting for the agent on VM" timeouts
26+
27+
- Run ```make reinstall-director```
28+
29+
Delete director:
30+
```shell
31+
make delete-director
32+
```
33+
### Upload Ubuntu/OS blob
1634

17-
```shell
18-
$ bosh upload-stemcell --sha1 d44dc2d1b3f8415b41160ad4f82bc9d30b8dfdce \
19-
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent?v=1.71
20-
```
35+
Note: If you ran ```make``` successfully, you can skip this step.
36+
37+
- [Uploading stemcells guide](https://bosh.io/docs/uploading-stemcells/)
38+
- [Official BOSH stemcells references (including SHAs)](https://bosh.io/stemcells).
39+
- The following is an example command to upload the Warden (BOSH Lite) Ubuntu Bionic (18.04.6 LTS) stemcell:
40+
41+
```shell
42+
bosh upload-stemcell --sha1 d44dc2d1b3f8415b41160ad4f82bc9d30b8dfdce \
43+
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent?v=1.71
44+
````
45+
46+
### Supplemental Documentation Links
47+
48+
[BOSH Release Documentation (Overview)](https://bosh.io/docs/create-release/)
49+
50+
[Quick Start Guide](https://bosh.io/docs/bosh-lite/)
2151

2252
## Create Local BOSH Release
2353

2454
```shell
25-
$ # Check release script for more environment variables that can be set.
26-
$ export IS_DEV_RELEASE=1
27-
$ ./release
55+
# Check release script for more environment variables that can be set.
56+
export IS_DEV_RELEASE=1
57+
./release
2858
```
2959

3060
## BOSH Release Usage
3161

3262
```shell
33-
$ bosh -d splunk-otel-collector deploy deployment.yaml
63+
bosh -d splunk-otel-collector deploy deployment.yaml
3464
```
3565
Further explanation of the `deployment.yaml` file is found [here.](#deployment-config)
3666

@@ -106,6 +136,9 @@ $ bosh deployments
106136
# View all bosh VMs. This will show if a deployment's VM is running or failed.
107137
$ bosh vms
108138
139+
# View debug logs for a task (e.g. upload or deploy) that failed
140+
$ bosh task task_number --debug
141+
109142
# View logs for a given deployment. Downloads a TAR file from the deployment.
110143
$ bosh logs -d <deployment-name>
111144
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright Splunk Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Explicitly define the shell we will use for commands.
16+
SHELL?=/bin/bash
17+
18+
.DEFAULT_GOAL=install-director
19+
20+
.PHONY: delete-director
21+
delete-director:
22+
./delete-director.sh
23+
24+
.PHONY: install-director
25+
install-director:
26+
./install-director.sh
27+
28+
.PHONY: reinstall-director
29+
reinstall-director: delete-director install-director

deployments/cloudfoundry/bosh/config/blobs.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright Splunk Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#!/bin/bash
16+
17+
set -euo pipefail
18+
19+
BOSH_DIRECTOR_DIR="./bosh-env/virtualbox"
20+
BOSH_DIRECTOR_DEPLOYMENT_DIR="bosh-deployment"
21+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
22+
23+
if [ -d $BOSH_DIRECTOR_DIR ] && [ -d $BOSH_DIRECTOR_DIR/$BOSH_DIRECTOR_DEPLOYMENT_DIR ]; then
24+
cd $BOSH_DIRECTOR_DIR
25+
./$BOSH_DIRECTOR_DEPLOYMENT_DIR/virtualbox/delete-env.sh
26+
cd $SCRIPT_DIR
27+
rm -rf $BOSH_DIRECTOR_DIR
28+
fi
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright Splunk Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#!/bin/bash
16+
17+
set -euo pipefail
18+
19+
BOSH_DIRECTOR_DIR="./bosh-env/virtualbox"
20+
BOSH_DIRECTOR_DEPLOYMENT_DIR="bosh-deployment"
21+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
22+
23+
if [ -d $BOSH_DIRECTOR_DIR/$BOSH_DIRECTOR_DEPLOYMENT_DIR ]; then
24+
echo "Bosh director already exists"
25+
echo "If you want to build again, run make reinstall-director"
26+
exit 0
27+
fi
28+
29+
mkdir -p $BOSH_DIRECTOR_DIR
30+
cd $BOSH_DIRECTOR_DIR
31+
32+
git clone --depth 1 https://github.com/cloudfoundry/bosh-deployment.git
33+
34+
./$BOSH_DIRECTOR_DEPLOYMENT_DIR/virtualbox/create-env.sh
35+
36+
source .envrc
37+
bosh -e vbox env
38+
39+
bosh -e vbox update-cloud-config bosh-deployment/warden/cloud-config.yml
40+
bosh upload-stemcell --sha1 d44dc2d1b3f8415b41160ad4f82bc9d30b8dfdce \
41+
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent?v=1.71
42+
43+
cd $SCRIPT_DIR

deployments/cloudfoundry/bosh/jobs/splunk-otel-collector/spec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ templates:
88

99
packages:
1010
- splunk_otel_collector
11-
- signalfx_agent
1211

1312
properties:
1413

0 commit comments

Comments
 (0)