Skip to content
Merged
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
151 changes: 151 additions & 0 deletions influxd-3.5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
package:
name: influxd-3.5
version: "3.5.0"
epoch: 0
description: Scalable datastore for metrics, events, and real-time analytics
copyright:
- license: MIT
dependencies:
provides:
- influxd=${{package.full-version}}
runtime:
- python3

environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- coreutils
- libprotobuf
- lld
- protobuf-dev
- protoc
- python3
- python3-dev
- rust
- rustup

var-transforms:
- from: ${{package.version}}
match: ^(\d+)\.\d+\.\d+$
replace: "$1"
to: major-version

pipeline:
- uses: git-checkout
with:
repository: https://github.com/influxdata/influxdb
tag: v${{package.version}}
expected-commit: a359575c82d87d72f22718df4ab9f092f4b5ba38
destination: influxdb

- runs: |
# TODO - move these
export CARGO_INCREMENTAL=yes
export CARGO_NET_GIT_FETCH_WITH_CLI=false
export PROFILE=release
export FEATURES=aws,gcp,azure,jemalloc_replacing_malloc
export PACKAGE=influxdb3

# Bump the thread count up, otherwise builds take a long time
export CARGO_JOBS=12


# Note: the static linking used in python standalone doesn't play
# nicely with packaging.
#
# We therefore don't use python standalone and instead pin a specific
# version of python as a dependency (which has the benefit that we'll
# continue to remediate CVEs)

# Create a directory to output build to. This is kept consistent with
# upstream for ease of maintenance
mkdir /influxdb3/target -p

# Build
cd influxdb
rustup toolchain install

cargo build --target-dir /influxdb3/target --package="$PACKAGE" --profile="$PROFILE" --no-default-features --features="$FEATURES"

objcopy --compress-debug-sections "/influxdb3/target/$PROFILE/$PACKAGE"

# This is where we start to deviate, we want to put the files where melange expects
#mkdir -p ${{targets.destdir}}/var/lib/influxdb3
#mkdir -p ${{targets.destdir}}/usr/lib/influxdb3
mkdir -p ${{targets.destdir}}/usr/bin

cp "/influxdb3/target/$PROFILE/$PACKAGE" ${{targets.destdir}}/usr/bin/$PACKAGE

# We're not building an image yet, so skip creation of the plugins dir
# mkdir -p ${{targets.destdir}}/plugins

- uses: strip

subpackages:
- name: ${{package.name}}-oci-entrypoint
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv entrypoint.sh ${{targets.subpkgdir}}/usr/bin/
dependencies:
runtime:
- bash
- busybox
- yq
# test added by a robot (binary)
test:
pipeline:
- runs: |
stat /usr/bin/entrypoint.sh

update:
enabled: true
# switched from github (releases) to git (tags) because in v3.5 apparently they forgot to push the release button
git:
strip-prefix: v
tag-filter-prefix: v3.5.

test:
environment:
contents:
packages:
- curl
- py3-psutil
pipeline:
- name: Version Tests
runs: |
influxdb3 --help
influxdb3 --version
- name: Start the influxd server
uses: test/daemon-check-output
with:
setup: |
mkdir /plugins
start: |
influxdb3 serve --object-store memory \
--node-id testnode \
--plugin-dir /plugins
timeout: 30
expected_output: |
InfluxDB 3 Core server starting
Creating shared query executor
startup time:.
- name: Write data
uses: test/daemon-check-output
with:
setup: |
mkdir /plugins
influxdb3 serve --object-store memory \
--node-id testnode \
--plugin-dir /plugins > /dev/null 2>&1 &
sleep 5
start: |
curl -H "Authorization: Bearer $(influxdb3 create token --admin | grep 'Token:' | cut -d\ -f2)" \
http://127.0.0.1:8181/write?db=test \
-d 'cpu,cpu=1234 user=1.0,system=0.1' -s -w 'Result: %{http_code}\n'
timeout: 30
expected_output: |
Result: 204
11 changes: 11 additions & 0 deletions influxd-3.5/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -eu -o pipefail

args=( "$@" )
for i in "${!args[@]}"; do
args[$i]="$(echo "${args[$i]}" | envsubst)"
done

exec "$PACKAGE" "${args[@]}"

Loading