Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tanzu Tile implementation and documentation #2726

Merged
merged 25 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f9fab82
Tanzu Tile implementation and docs
crobert-1 Feb 21, 2023
33292e3
Add GitHub Tanzu Tile test action
crobert-1 Mar 14, 2023
fa3091b
Remove Smart Agent dependency
crobert-1 Mar 15, 2023
452c4ae
Address comments from Ryan
crobert-1 Mar 16, 2023
7e1b197
Use icon from o11y product design
crobert-1 Mar 20, 2023
db49182
Rename tile to match proper convention
crobert-1 Mar 20, 2023
1150615
Add Tanzu Tile images
crobert-1 Mar 23, 2023
a2b92ed
Try to use stat instead of find for tile github action
crobert-1 Mar 23, 2023
5ec066f
Update collector references for clarity
crobert-1 Mar 24, 2023
a1d9229
Updates requested by Antoine
crobert-1 Mar 24, 2023
31e616f
Set shell and pipefail in makefile scripts
crobert-1 Mar 24, 2023
003c6a5
Add license header
crobert-1 Mar 24, 2023
4d27880
Remove -x flag from set command
crobert-1 Mar 24, 2023
80d16a1
Update tile image with new name and image
crobert-1 Mar 24, 2023
aa0402e
Add Tanzu tile workflow output as artifact
crobert-1 Mar 27, 2023
9678199
Another upload artifact attempt
crobert-1 Mar 27, 2023
d67af0a
Use env variable for access across steps
crobert-1 Mar 27, 2023
f34caa4
Change variable setting to proper syntax
crobert-1 Mar 27, 2023
3d107c0
Try another tile path
crobert-1 Mar 27, 2023
a472003
Try debugging for tile file
crobert-1 Mar 27, 2023
449a004
Debugging after upload attempt
crobert-1 Mar 27, 2023
a158f83
Use full path
crobert-1 Mar 27, 2023
a225fd7
Full path cleaned up
crobert-1 Mar 27, 2023
abd8af5
Update tile file extension
crobert-1 Mar 27, 2023
eb317eb
Make TLS validation opt out
crobert-1 Mar 28, 2023
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
3 changes: 2 additions & 1 deletion .github/workflows/bosh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@0c611abec1fc679030907286a2c084cc92fb8f2e
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@251cc053a43110ce4dea3cdb6f038147c82d0257
- name: Install BOSH CLI
shell: bash
run: |
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/tanzu-tile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tanzu Tile

# The workflow triggered by any change in deployments/cloudfoundry/bosh/
# or /deployments/cloudfoundry/tile

on:
pull_request:
paths:
- 'deployments/cloudfoundry/bosh/**'
- 'deployments/cloudfoundry/tile/**'

permissions:
contents: write

defaults:
run:
working-directory: 'deployments/cloudfoundry/tile'

jobs:

test:
name: Test Tanzu Tile creation
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install BOSH CLI
shell: bash
run: |
brew install cloudfoundry/tap/bosh-cli
bosh -v
- name: Install PCF CLI
shell: bash
run: |
pip install tile-generator
- name: Run release script
shell: bash
run: |
./make-latest-tile
FILE=""
size="$(stat -c '%s' product/splunk-otel-collector-*.pivotal)"
if [[ $size -eq 0 ]]; then
echo "File is empty!" >&2
exit 1
fi
18 changes: 16 additions & 2 deletions deployments/cloudfoundry/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# Splunk OpenTelemetry Collector Pivotal Cloud Foundry (PCF) Integrations

Supported Tanzu Application Service (TAS) versions: v2

Unsupported TAS versions: v3

### Cloud Foundry Buildpack

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

### Bosh Release

This is a Bosh release of the Splunk Collector. This deploys the Collector to the PCF
environment as a standalone deployment.
This is a Bosh release of the Collector. This deploys the Collector to the PCF
environment as a standalone deployment.

### Tanzu Tile

This is a Tanzu Tile of the Collector, which is a packaged release of the collector
that can be integrated into the Ops Manager. The Tanzu Tile enables users to download, install,
run, configure, and update the collector all from the Ops Manager.

[Tanzu Tile UI](./tile/resources/tanzu_tile_in_ops_mgr.png)

[Tanzu Tile Configuration UI](./tile/resources/tanzu_tile_config_options.png)
crobert-1 marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions deployments/cloudfoundry/bosh/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
latest-release.tgz
signalfx-agent.tar.gz
splunk_otel_collector
.dev_builds
blobs
dev_releases
dev_releases
bosh-env
65 changes: 49 additions & 16 deletions deployments/cloudfoundry/bosh/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,65 @@

## Getting Started

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

[Quick Start Guide](https://bosh.io/docs/bosh-lite/)
[Local machine prerequisites](https://bosh.io/docs/quick-start/#prerequisites)
- The latest VirtualBox environment v7 is incompatible with this
functionality. Downgrade VirtualBox to [v6](https://www.virtualbox.org/wiki/Download_Old_Builds_6_1) to
ensure it can work. Tested successfully on `v6.1.42`


Automated start process:
```shell
# Sets up BOSH Director locally
make
# Makes sure local shell gets proper credentials to access director
source bosh-env/virtualbox/.envrc
```

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

- Make sure director is running
- Quick start guide to run a BOSH Director can be found [here.](https://bosh.io/docs/quick-start/)
- Need to upload right Ubuntu/OS blob
- Guide can be found [here.](https://bosh.io/docs/uploading-stemcells/)
- The following is an example command to upload the Warden (BOSH Lite) Ubuntu Bionic (18.04.6 LTS) stemcell:
Common Errors:
- "Waiting for the agent on VM" timeouts

- Run ```make reinstall-director```

Delete director:
```shell
make delete-director
```
### Upload Ubuntu/OS blob

```shell
$ bosh upload-stemcell --sha1 d44dc2d1b3f8415b41160ad4f82bc9d30b8dfdce \
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent?v=1.71
```
Note: If you ran ```make``` successfully, you can skip this step.

- [Uploading stemcells guide](https://bosh.io/docs/uploading-stemcells/)
- [Official BOSH stemcells references (including SHAs)](https://bosh.io/stemcells).
- The following is an example command to upload the Warden (BOSH Lite) Ubuntu Bionic (18.04.6 LTS) stemcell:

```shell
bosh upload-stemcell --sha1 d44dc2d1b3f8415b41160ad4f82bc9d30b8dfdce \
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent?v=1.71
````

### Supplemental Documentation Links

[BOSH Release Documentation (Overview)](https://bosh.io/docs/create-release/)

[Quick Start Guide](https://bosh.io/docs/bosh-lite/)

## Create Local BOSH Release

```shell
$ # Check release script for more environment variables that can be set.
$ export IS_DEV_RELEASE=1
$ ./release
# Check release script for more environment variables that can be set.
export IS_DEV_RELEASE=1
./release
```

## BOSH Release Usage

```shell
$ bosh -d splunk-otel-collector deploy deployment.yaml
bosh -d splunk-otel-collector deploy deployment.yaml
```
Further explanation of the `deployment.yaml` file is found [here.](#deployment-config)

Expand Down Expand Up @@ -106,6 +136,9 @@ $ bosh deployments
# View all bosh VMs. This will show if a deployment's VM is running or failed.
$ bosh vms

# View debug logs for a task (e.g. upload or deploy) that failed
$ bosh task task_number --debug

# View logs for a given deployment. Downloads a TAR file from the deployment.
$ bosh logs -d <deployment-name>

Expand Down
29 changes: 29 additions & 0 deletions deployments/cloudfoundry/bosh/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright Splunk Inc.
#
# 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.

# Explicitly define the shell we will use for commands.
SHELL?=/bin/bash

.DEFAULT_GOAL=install-director

.PHONY: delete-director
delete-director:
./delete-director.sh

.PHONY: install-director
install-director:
./install-director.sh

.PHONY: reinstall-director
reinstall-director: delete-director install-director
6 changes: 0 additions & 6 deletions deployments/cloudfoundry/bosh/config/blobs.yml

This file was deleted.

28 changes: 28 additions & 0 deletions deployments/cloudfoundry/bosh/delete-director.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright Splunk Inc.
#
# 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.

#!/bin/bash

set -exuo pipefail
crobert-1 marked this conversation as resolved.
Show resolved Hide resolved

BOSH_DIRECTOR_DIR="./bosh-env/virtualbox"
crobert-1 marked this conversation as resolved.
Show resolved Hide resolved
BOSH_DIRECTOR_DEPLOYMENT_DIR="bosh-deployment"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -d $BOSH_DIRECTOR_DIR ] && [ -d $BOSH_DIRECTOR_DIR/$BOSH_DIRECTOR_DEPLOYMENT_DIR ]; then
cd $BOSH_DIRECTOR_DIR
./$BOSH_DIRECTOR_DEPLOYMENT_DIR/virtualbox/delete-env.sh
cd $SCRIPT_DIR
rm -rf $BOSH_DIRECTOR_DIR
fi
43 changes: 43 additions & 0 deletions deployments/cloudfoundry/bosh/install-director.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright Splunk Inc.
#
# 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.

#!/bin/bash

set -exuo pipefail
crobert-1 marked this conversation as resolved.
Show resolved Hide resolved

BOSH_DIRECTOR_DIR="./bosh-env/virtualbox"
crobert-1 marked this conversation as resolved.
Show resolved Hide resolved
BOSH_DIRECTOR_DEPLOYMENT_DIR="bosh-deployment"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -d $BOSH_DIRECTOR_DIR/$BOSH_DIRECTOR_DEPLOYMENT_DIR ]; then
echo "Bosh director already exists"
echo "If you want to build again, run make reinstall-director"
exit 0
fi

mkdir -p $BOSH_DIRECTOR_DIR
cd $BOSH_DIRECTOR_DIR

git clone --depth 1 https://github.com/cloudfoundry/bosh-deployment.git

./$BOSH_DIRECTOR_DEPLOYMENT_DIR/virtualbox/create-env.sh

source .envrc
bosh -e vbox env

bosh -e vbox update-cloud-config bosh-deployment/warden/cloud-config.yml
bosh upload-stemcell --sha1 d44dc2d1b3f8415b41160ad4f82bc9d30b8dfdce \
https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent?v=1.71

cd $SCRIPT_DIR
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ templates:

packages:
- splunk_otel_collector
- signalfx_agent

properties:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ case $1 in

echo $$ > $PIDFILE

exec /var/vcap/packages/splunk_otel_collector/splunk_otel_collector \
# Collector needs to be run as user that has permissions to get metrics from RLP
# gateway
exec chpst -u vcap:vcap /var/vcap/packages/splunk_otel_collector/splunk_otel_collector \
--config /var/vcap/jobs/splunk-otel-collector/bin/config/otel-collector-config.yaml \
>> $LOG_DIR/splunk-otel-collector.stdout.log \
2>> $LOG_DIR/splunk-otel-collector.stderr.log
Expand Down
16 changes: 0 additions & 16 deletions deployments/cloudfoundry/bosh/packages/signalfx_agent/packaging

This file was deleted.

7 changes: 0 additions & 7 deletions deployments/cloudfoundry/bosh/packages/signalfx_agent/spec

This file was deleted.

Loading