Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
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
12 changes: 11 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
sccache --show-stats

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.postgres.version }}

- name: Install cargo-pgx
run: |
Expand All @@ -44,10 +46,18 @@ jobs:
- name: Initialize pgx
if: ${{ steps.cache-pgx.outputs.cache-hit != 'true' }}
run: cargo pgx init --pg${{ matrix.postgres.version }} download

- name: Run cargo test
run: cargo pgx test pg${{ matrix.postgres.version }}

# Note: pgx puts the postgres test configuration data in target/pgx-test-data-<pg_ver>
# Swatinem/rust-cache "cleans" and then caches this directory. This
# "cleaning" breaks pgx when the cache is restored. By removing the
# directory, we prevent it from being incorrectly cached.
- name: Remove pgx-test-data directory
run: |
rm -rf target/pgx-test-data*

- name: Show sccache stats
run: sccache --show-stats

4 changes: 3 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
docker:
runs-on: ubuntu-latest
if: github.repository == 'timescale/promscale_extension'
outputs:
branch_name: ${{steps.metadata.outputs.branch_name}}
image_branch_name: ${{steps.metadata.outputs.image_branch_name}}
Expand Down Expand Up @@ -125,6 +126,7 @@ jobs:

pick-connector-branch:
name: picking connector's repo branch
if: github.repository == 'timescale/promscale_extension'
runs-on: ubuntu-latest
needs:
- docker
Expand Down Expand Up @@ -165,7 +167,7 @@ jobs:
# otherwise we have to keep updating them as we add or remove postgres versions etc.
docker-result:
name: docker result
if: always()
if: always() && github.repository == 'timescale/promscale_extension'
needs:
- docker
- call-connector-e2e
Expand Down
42 changes: 36 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ on:

jobs:
package:
runs-on: ubuntu-latest
runs-on: ${{ matrix.arch.runner }}
env:
RUST_VERSION: "1.64.0"
strategy:
fail-fast: false
matrix:
arch:
- cpu: aarch64
platform: arm64
runner: [self-hosted, Linux, ARM64]
- cpu: x86_64
platform: amd64
runner: ubuntu-latest
os:
- name: linux
distro: debian
Expand Down Expand Up @@ -71,7 +75,15 @@ jobs:
- version: "12"
- version: "13"
- version: "14"

exclude:
# The centos build doesn't work on arm64
- os:
distro: centos
arch:
platform: arm64
# exclude arm64 on the promscale_extension repo, and exclude amd64 in the promscale_extension_private repo
- arch:
platform: ${{ github.repository == 'timescale/promscale_extension' && 'arm64' || 'amd64' }}
steps:
- name: Install PackageCloud
if: ${{ startsWith(github.ref, 'refs/tags') }}
Expand All @@ -80,6 +92,9 @@ jobs:

- uses: actions/checkout@v3

- name: Install rust
uses: dtolnay/rust-toolchain@1.64.0

- name: Gather Metadata
id: metadata
run: |
Expand All @@ -106,11 +121,15 @@ jobs:
echo "ghopts=${ghopts}" >> ${GITHUB_OUTPUT}
echo "image=promscale-extension:${tag}.pg${{ matrix.postgres.version }}.${{ matrix.os.distro }}${{ matrix.os.version }}" >> ${GITHUB_OUTPUT}

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
# This is necessary on self-hosted runners
- name: Create build context
run: |
docker context create builder

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builder

- name: Build Package
uses: docker/build-push-action@v3
Expand Down Expand Up @@ -143,6 +162,8 @@ jobs:
ls -la artifacts/*

- name: Test package
# We can't test the package on arm64 because there is no timescaledb install for arm64
if: matrix.arch.platform != 'arm64'
env:
DISTRO: ${{ matrix.os.distro }}
DISTRO_VERSION: ${{ matrix.os.version }}
Expand Down Expand Up @@ -226,8 +247,17 @@ jobs:
cat dist/RELEASE_NOTES.md

- name: Create Release
if: ${{ startsWith(github.ref, 'refs/tags') }}
if: ${{ startsWith(github.ref, 'refs/tags') && github.repository == 'timescale/promscale_extension' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create --repo timescale/promscale_extension --target ${GITHUB_SHA} ${{ needs.package.outputs.ghopts }} --notes-file dist/RELEASE_NOTES.md ${{ needs.package.outputs.version }} artifacts/*

# Note: This assumes that the arm64 build reaches this point after the
# above `gh release create` command in the amd64 build
- name: Attach arm64 artifacts to release
if: ${{ startsWith(github.ref, 'refs/tags') && github.repository == 'timescale/promscale_extension_private' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create -R timescale/promscale_extension --target ${GITHUB_SHA} ${{ needs.package.outputs.ghopts }} --notes-file dist/RELEASE_NOTES.md ${{ needs.package.outputs.version }} artifacts/*
gh release upload --repo timescale/promscale_extension ${{ needs.package.outputs.version }} artifacts/*
6 changes: 4 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ Create a new issue titled "Release `<version to be released here>`". Copy everyt
## Release
- [ ] Create a tag on the master branch `git tag <new version>`
- [ ] Push the tag `git push origin <new version>`
- [ ] CI will trigger and create a draft release with assets attached.
- [ ] CI will trigger the `release` job, which (when it completes) will create a draft release with assets attached.
- [ ] Push the tag to the `promscale_extension_private` repository `git push private <new version>`.
- [ ] Validate that the arm64 package build is triggered in the `promscale_extension_private` repo.
- [ ] Prepare extension release notes, share with team asking for feedback.
- [ ] Wait for CI to generate the packages, validate that _both_ `x86_64` and `aarch64` packages are present.
- [ ] Attach release notes to draft release created above.
- [ ] Wait for CI to generate the packages files
- [ ] Create a PR to update the HA image in [timescaledb-docker-ha](https://github.com/timescale/timescaledb-docker-ha). [EXAMPLE](https://github.com/timescale/timescaledb-docker-ha/pull/285/files)
- [ ] In the timescaledb-docker-ha repo, update `TIMESCALE_PROMSCALE_EXTENSIONS` in the `Makefile` to include the version just released
- [ ] Update the CHANGELOG entry in the timescaledb-docker-ha repo and wait for the CI to complete and request review from the Cloud team and merge it when approved.
Expand Down
4 changes: 3 additions & 1 deletion dist/deb.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ apt-get install -y \
git \
lintian \
pkg-config \
rubygems
rubygems \
clang \
libclang-dev

# Install FPM
gem install fpm
Expand Down