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

Release testing, ignore #122

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e64fa8e
Use otelcol-config for config manipulations
ccressent Aug 2, 2024
97a27a4
Remove write_sumologic_extension
ccressent Aug 27, 2024
0eb43e2
Install otelcol-config in test-install-script job (#111)
echlebek Aug 28, 2024
39797a7
Remove the concept of systemd from install script
echlebek Aug 28, 2024
a6885de
Remove systemd concepts
echlebek Aug 28, 2024
de2a294
Remove unused code
echlebek Aug 28, 2024
388a81b
Move much of the script to otelcol-config
echlebek Aug 29, 2024
7445b33
Merge branch 'main' into osc800-otelcol-config-refactor
echlebek Aug 29, 2024
5719b04
Fix infinite loop in script
echlebek Aug 30, 2024
867c1c0
Return 2 on incorrect usage
echlebek Aug 30, 2024
6130a08
Hardcode app version for now
echlebek Aug 30, 2024
8e3b87e
Don't try to get latest release in install script tests
echlebek Aug 30, 2024
69c7ee0
Install package repositories with install.sh
echlebek Aug 30, 2024
ebb767e
Fix debian package uninstallation
echlebek Aug 30, 2024
bf3405a
Add -y to package removal calls
echlebek Aug 30, 2024
6ec1076
Test speculative change
echlebek Aug 30, 2024
38c9d60
Support --purge for apt-get
echlebek Aug 30, 2024
bbcce55
Use --purge in script tests
echlebek Aug 30, 2024
64972ac
Remove autoconfirm tests on linux
echlebek Aug 30, 2024
d5107a9
Don't do user checks
echlebek Aug 30, 2024
b1d188e
Fixes for darwin and windows
echlebek Aug 30, 2024
c9fadf8
Fix add-tag routine
echlebek Aug 30, 2024
a8510d1
Don't show usage for no args when token env set
echlebek Aug 30, 2024
76cfe53
use --quiet for calling package managers
echlebek Aug 30, 2024
be149ca
Fix crash when otelcol-config is not yet installed
echlebek Aug 30, 2024
2ec9db3
Use more --quiet
echlebek Aug 30, 2024
845bfb8
Use otelcol-config for darwin-specific subroutine
echlebek Aug 30, 2024
25fb279
Replace common.yaml with 00-otelcol-config-settings.yaml
echlebek Aug 30, 2024
f26db43
Merge branch 'main' into osc800-otelcol-config-refactor
echlebek Sep 3, 2024
c80cbe4
Complain when installation token not provided
echlebek Sep 3, 2024
5655ac8
Use otelcol-config for configuration in install.sh
echlebek Sep 3, 2024
bd4d24e
upload packages & install scripts to s3
amdprophet Nov 1, 2024
a994849
Add docs/release.md (#121)
amdprophet Nov 5, 2024
eff559c
add new release workflow & docs
amdprophet Nov 5, 2024
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
54 changes: 41 additions & 13 deletions .github/workflows/_reusable_build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ on:
required: false
type: boolean
default: false
packagecloud_go_version:
required: false
type: string
default: "0.2.2"
secrets:
gh_artifacts_token:
required: true
Expand All @@ -61,6 +65,14 @@ on:
required: true
packagecloud_token:
required: true
aws_access_key_id:
required: true
aws_secret_access_key:
required: true
outputs:
otc_build_number:
description: "The build number of the package"
value: ${{ jobs.build_package.outputs.otc_build_number }}

defaults:
run:
Expand All @@ -72,23 +84,12 @@ jobs:
name: Build (CMake)
if: inputs.build_tool == 'cmake'
outputs:
otc_build_number: ${{ steps.get-build-number.outputs.otc_build_number }}
package_path: ${{ steps.package.outputs.path }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download packagecloud-go tool
run: |
baseURL="https://github.com/amdprophet/packagecloud-go/releases/download"
version="0.1.5"
file="packagecloud-go_${version}_linux_amd64.tar.gz"
curl -Lo /tmp/packagecloud-go.tar.gz $baseURL/$version/$file

- name: Install packagecloud-go tool
run: |
tar -C /tmp -zxf /tmp/packagecloud-go.tar.gz
sudo mv /tmp/packagecloud /usr/local/bin

- name: Workflow URL for sumologic-otel-collector
if: ${{ !inputs.use_release_artifacts && inputs.workflow_id != '' }}
run: |
Expand All @@ -97,6 +98,15 @@ jobs:
workflow_id="${{ inputs.workflow_id }}"
echo "https://github.com/${org}/${repo}/actions/runs/${workflow_id}"

# Only output build number on one target so that it can be read by other
# jobs
- name: Output Build Number
if: inputs.cmake_target == 'otc_linux_amd64_deb'
id: get-build-number
run: |
build_number="${{ inputs.otc_build_number }}"
echo "otc_build_number=${build_number}" >> $GITHUB_OUTPUT

- name: Determine if MacOS package should be signed
if: runner.os == 'macOS'
env:
Expand Down Expand Up @@ -228,12 +238,30 @@ jobs:
path: ./build/${{ steps.package.outputs.path }}
if-no-files-found: error

- name: Publish package to Packagecloud
- name: Publish packages
if: runner.os == 'Linux'
uses: ./ci/github-actions/make
with:
target: publish-package
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Publish packages
if: runner.os != 'Linux'
working-directory: build
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: make publish-package

- name: Wait for Packagecloud packages to be indexed
if: runner.os == 'Linux'
uses: ./ci/github-actions/make
with:
target: wait-for-packagecloud-indexing
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}

test_package:
runs-on: ${{ inputs.runs_on }}
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ on:
type: boolean
required: false
default: false
is_latest:
type: boolean
required: false
default: false

jobs:
determine_workflow:
Expand Down Expand Up @@ -199,6 +203,8 @@ jobs:
microsoft_description: ${{ secrets.MICROSOFT_DESCRIPTION }}
gh_ci_token: ${{ secrets.GH_CI_TOKEN }}
packagecloud_token: ${{ secrets.PACKAGECLOUD_TOKEN }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

strategy:
matrix:
Expand Down Expand Up @@ -249,6 +255,16 @@ jobs:
install-script:
name: Store install script
runs-on: ubuntu-latest
needs:
- determine_version
- build_packages
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_BUCKET: sumologic-osc-ci-builds
OTC_VERSION: ${{ needs.determine_version.outputs.otc_version }}
BUILD_NUMBER: ${{ needs.build_packages.outputs.otc_build_number }}
steps:
- uses: actions/checkout@v4

Expand All @@ -266,6 +282,23 @@ jobs:
path: ./install-script/install.ps1
if-no-files-found: error

- name: Store install scripts on S3
run: |
version="${OTC_VERSION}-${BUILD_NUMBER}"
s3_path="${version}/"
aws s3 cp install-script/install.ps1 s3://${AWS_S3_BUCKET}/${s3_path}
aws s3 cp install-script/install.sh s3://${AWS_S3_BUCKET}/${s3_path}

- name: Create latest_version file
if: inputs.is_latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
version="${OTC_VERSION}-${BUILD_NUMBER}"
echo "${version}" >> latest_version
aws s3 cp --content-type "text/plain" latest_version s3://${AWS_S3_BUCKET}/

publish_release:
name: Publish Release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -331,3 +364,74 @@ jobs:
This release packages [${{ env.OTC_APP_VERSION }}](https://github.com/SumoLogic/sumologic-otel-collector/releases/tag/${{ env.OTC_APP_VERSION }}).

The changelog below is for the package itself, rather than the Sumo Logic Distribution for OpenTelemetry Collector.

test-install-script:
name: Test Install Script
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 60
needs:
- determine_version
- build_packages
strategy:
fail-fast: false
matrix:
include:
- arch_os: linux_amd64
runs_on: ubuntu-20.04
- arch_os: darwin_amd64
runs_on: macos-latest
- arch_os: windows_amd64
runs_on: windows-2022
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OTC_VERSION: ${{ needs.determine_version.outputs.otc_version }}
OTC_BUILD_NUMBER: ${{ github.run_number }}
PACKAGECLOUD_MASTER_TOKEN: ${{ secrets.PACKAGECLOUD_MASTER_TOKEN }}
PACKAGECLOUD_REPO: ci-builds
steps:
- uses: actions/checkout@v4

- name: Check if test related files changed
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
install-script/**/*
.github/**

- name: Setup go
if: steps.changed-files.outputs.any_changed == 'true'
uses: WillAbides/setup-go-faster@v1
with:
go-version: stable

- name: Download macOS package and use it for install.sh
if: ${{ steps.changed-files.outputs.any_changed == 'true' && runner.os == 'macOS' }}
uses: actions/download-artifact@v4
with:
path: artifacts/
pattern: otelcol-sumo_*-intel.pkg

- name: Show packages
if: ${{ steps.changed-files.outputs.any_changed == 'true' && runner.os == 'macOS' }}
run: |
ls -l artifacts/
ls -l artifacts/**/*

- name: Set DARWIN_PKG_URL
if: ${{ steps.changed-files.outputs.any_changed == 'true' && runner.os == 'macOS' }}
run: |
fp="$(readlink -f artifacts/otelcol-sumo_*-intel.pkg/otelcol-sumo_*-intel.pkg)"
echo DARWIN_PKG_URL="file://${fp}" >> $GITHUB_ENV

- name: Run install script tests (*nix)
if: steps.changed-files.outputs.any_changed == 'true' && runner.os != 'Windows'
working-directory: install-script/test
run: make test

- name: Run install script tests (Windows)
shell: powershell
if: steps.changed-files.outputs.any_changed == 'true' && runner.os == 'Windows'
working-directory: install-script/test
run: make test
Loading
Loading