Skip to content

Commit

Permalink
Post merge cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <[email protected]>
  • Loading branch information
Licenser committed Sep 15, 2020
1 parent aaa2357 commit a0d9b06
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 65 deletions.
3 changes: 1 addition & 2 deletions .github/checks/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ code sanity checker
-h show this help
-a run all chekcs
-c curl
-t tremor-tool
-t tremor
-e eqc
EOF
}
Expand Down Expand Up @@ -58,6 +58,5 @@ while getopts hacte opt; do
help
exit 0
;;

esac
done
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ tremor.log
docs
/packaging/out/
report.txt
report.json
tremor-server.*
report.json
2 changes: 1 addition & 1 deletion .rpm/tremor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Requires(postun): systemd
%setup -q

%build
# we rely on binaries pre-built alrady in the Source0 tar file
# we rely on binaries pre-built already in the Source0 tar file
# so this section is empty for us.

%install
Expand Down
30 changes: 10 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'tremor-server'",
"name": "Debug executable 'tremor'",
"cargo": {
"args": ["build", "--bin=tremor-server", "--package=tremor-server"],
"args": ["build", "--bin=tremor", "--package=tremor-cli"],
"filter": {
"name": "tremor-server",
"name": "tremor",
"kind": "bin"
}
},
Expand All @@ -331,9 +331,9 @@
"request": "launch",
"name": "Debug real-workflow-throughput-json",
"cargo": {
"args": ["build", "--bin=tremor-server", "--package=tremor-server"],
"args": ["build", "--bin=tremor", "--package=tremor-cli"],
"filter": {
"name": "tremor-server",
"name": "tremor",
"kind": "bin"
}
},
Expand All @@ -350,14 +350,9 @@
"request": "launch",
"name": "Release real-workflow-throughput-json",
"cargo": {
"args": [
"build",
"--bin=tremor-server",
"--package=tremor-server",
"--release"
],
"args": ["build", "--bin=tremor", "--package=tremor-cli", "--release"],
"filter": {
"name": "tremor-server",
"name": "tremor",
"kind": "bin"
}
},
Expand All @@ -372,16 +367,11 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'tremor-server'",
"name": "Debug unit tests in executable 'tremor'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=tremor-server",
"--package=tremor-server"
],
"args": ["test", "--no-run", "--bin=tremor", "--package=tremor-cli"],
"filter": {
"name": "tremor-server",
"name": "tremor",
"kind": "bin"
}
},
Expand Down
15 changes: 10 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Contributing to Tremor

[contributing-to-tremor]: #contributing-to-tremor

Thank you for your interest in contributing to the Tremor project! There are many ways to
Expand Down Expand Up @@ -27,6 +28,7 @@ any guidance or assistance.
[code-of-conduct]: https://docs.tremor.rs/CodeOfConduct

## Feature Requests

[feature-requests]: #feature-requests

To request a change to the way that Tremor works, please head over
Expand All @@ -35,6 +37,7 @@ to the [RFCs repository](https://github.com/tremor-rs/tremor-rfcs) and view the
for instructions.

## Bug Reports

[bug-reports]: #bug-reports

While bugs are unfortunate, they're a reality in software. We can't fix what we
Expand Down Expand Up @@ -80,16 +83,16 @@ use it exactly:
```

All three components are important: what you did, what you expected, what
happened instead. Please include the output of `tremor-server --version`,
happened instead. Please include the output of `tremor --version`,
which includes important information about what platform you're on, what
version of Rust you're using, etc.

Sometimes, a backtrace is helpful, and so including that is nice. To get
a backtrace, set the `RUST_BACKTRACE` environment variable to a value
other than `0`. The easiest way to do this is to invoke `tremor-server` like this:
other than `0`. The easiest way to do this is to invoke `tremor` like this:

```bash
$ RUST_BACKTRACE=1 tremor-server...
$ RUST_BACKTRACE=1 tremor...
```

## The Build System
Expand All @@ -101,6 +104,7 @@ really useful commands to the build system, which could save you a lot of time.
[tremor-build-guide]: http://docs.tremor.rs/development/quick-start/

## Pull Requests

[pull-requests]: #pull-requests

Pull requests are the primary mechanism we use to change Tremor. GitHub itself
Expand Down Expand Up @@ -164,8 +168,8 @@ it can be found [here][https://github.com/tremor-rs/tremor-www-docs/blob/main/do

Currently building the Tremor project will also build the following external projects:

* [clippy](https://github.com/rust-lang/rust-clippy)
* [rustfmt](https://github.com/rust-lang/rustfmt)
- [clippy](https://github.com/rust-lang/rust-clippy)
- [rustfmt](https://github.com/rust-lang/rustfmt)

Breakage is not allowed in released branches and must be addressed before a PR is merged.

Expand Down Expand Up @@ -205,6 +209,7 @@ Answer questions in the _Get Help!_ channels from the [Tremor Chat][tremor-chat]
Participate in the [RFC process](https://github.com/tremor-rs/tremor-rfcs).

## Tremor Chat

[tremor-chat]: #tremor-chat

Join the tremor community [slack](https://join.slack.com/t/tremor-debs/shared_invite/enQtOTMxNzY3NDg0MjI2LTQ4MTU4NjlkZDk0MmJmNmIwYjU0ZDc1OTNjMGRmNzUwZTdlZGVkMWFmNGFkZTAwOWJlYjlkMDZkNGNiMjQ2NzI)
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ depends = "libc6 (>= 2.17), libstdc++6, libatomic1"
maintainer-scripts = "packaging/distribution/debian/maintainer-scripts/"
assets = [
# target path will be automatically corrected when cross-compiling
["target/release/tremor-server", "/usr/bin/", "755"],
["target/release/tremor", "/usr/bin/", "755"],
["README.md", "/usr/share/doc/tremor/", "644"],
["LICENSE", "/usr/share/doc/tremor/", "644"],
# need to specify each directory contents since only actual file entries are allowed here
Expand Down Expand Up @@ -162,7 +162,7 @@ package = "tremor"
buildflags = ["--release"]
profile = "release"
[package.metadata.rpm.targets]
tremor-server = { path = "/usr/bin/tremor-server" }
tremor = { path = "/usr/bin/tremor" }
# The LHS paths here are relative to the rpm config dir (.rpm at project root).
# If you add new files here, please make sure to add them to %files section in
# the rpm spec file (inside .rpm) -- otherwise the rpm packaging will fail.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.45.0 as builder
FROM rust:1.46.0 as builder

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.45.0 as builder
FROM rust:1.46.0 as builder

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ VSN=$(DOCKER_VSN)
YEAR=2018-2020

RELEASE_TARGETS := \
x86_64-unknown-linux-gnu \
x86_64-alpine-linux-musl \
# x86_64-unknown-linux-gnu
# fails on snmalloc builds currently so disabled
# TODO if we fix this, we don't need the alpine specifc target above for musl builds
#x86_64-unknown-linux-musl \
Expand Down Expand Up @@ -61,7 +61,7 @@ it:
cd tremor-cli && TREMOR_PATH=../tremor-script/lib tremor test integration tests -i integration -e ws

bench: force
cargo build --release -p tremor-server
cargo build --release -p tremor
./bench/all.sh | tee bench-`date +%s`.txt

force:
Expand Down
4 changes: 2 additions & 2 deletions bench/run
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo "TARGET_ROOT: ${TARGET_ROOT}"

if [ -d ${BENCH_ROOT}/$1 ]
then
TREMOR_PATH="${BENCH_ROOT}/../tremor-script/lib" ${BENCH_EXTRA} ${TARGET_ROOT}/${TARGET_MODE}/tremor-server --no-api -c $file bench/link.yaml --query ./bench/$1/*.trickle
TREMOR_PATH="${BENCH_ROOT}/../tremor-script/lib" ${BENCH_EXTRA} ${TARGET_ROOT}/${TARGET_MODE}/tremor server run --no-api -f $file bench/link.yaml ./bench/$1/*.trickle
else
TREMOR_PATH="${BENCH_ROOT}/../tremor-script/lib" ${BENCH_EXTRA} ${TARGET_ROOT}/${TARGET_MODE}/tremor-server --no-api -c $file bench/link.yaml
TREMOR_PATH="${BENCH_ROOT}/../tremor-script/lib" ${BENCH_EXTRA} ${TARGET_ROOT}/${TARGET_MODE}/tremor server run --no-api -f $file bench/link.yaml
fi
6 changes: 3 additions & 3 deletions bench/scale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ if [ -f "$1" ]
then
TARGET=$1
else
TARGET=target/release/tremor-server
TARGET=target/release/tremor
fi

echo "(3 cores)"
for i in 1 2 4 8 16 32 64
do
taskset -c 0,1,2 $TARGET --no-api -c ./bench/real-workflow-throughput-json-$i-$i-1.yaml bench/link.yaml 2>&1 | grep Throughput | sed -e 's/Throughput: //' -e 's; MB/s;;'
taskset -c 0,1,2 $TARGET server run --no-api -f ./bench/real-workflow-throughput-json-$i-$i-1.yaml bench/link.yaml 2>&1 | grep Throughput | sed -e 's/Throughput: //' -e 's; MB/s;;'
done

echo "(all cores)"
for i in 1 2 4 8 16 32 64
do
$TARGET --no-api -c ./bench/real-workflow-throughput-json-$i-$i-1.yaml bench/link.yaml 2>&1 | grep Throughput | sed -e 's/Throughput: //' -e 's; MB/s;;'
$TARGET server run --no-api -f ./bench/real-workflow-throughput-json-$i-$i-1.yaml bench/link.yaml 2>&1 | grep Throughput | sed -e 's/Throughput: //' -e 's; MB/s;;'
done
2 changes: 1 addition & 1 deletion demo/demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
depends_on:
- influx
tremor:
image: tremor
image: tremorproject/tremor:latest
depends_on:
- kibana
- kafka
Expand Down
42 changes: 21 additions & 21 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

Collects all the resources necessary for successfully packaging our rust project for various [targets](https://doc.rust-lang.org/rustc/targets/built-in.html), across different formats.

### Prerequisites

- bash
- git
- cargo
- docker
- dpkg, ldd (optionally, to auto-infer dynamic lib dependencies during debian packaging, via [cargo-deb](https://github.com/mmstick/cargo-deb#installation))
- rpmbuild (for building rpms, via [cargo-rpm](https://github.com/iqlusioninc/cargo-rpm.git)) (`apt install rpm`)

The setup here was tested successfully from linux (ubuntu) environments, but it should work well in other environments too, as long as the above requirements are met.

## Usage

The main packaging functionality here is exposed via [run.sh](run.sh) -- please refer to the script header there for more details on its usage.
Expand Down Expand Up @@ -32,37 +43,26 @@ Other examples, using the scripts here directly:

If you need to build the docker images used during the cross build process, please refer to the documentation on [builder-images](./builder-images).

### Requirements

* bash
* git
* cargo
* docker
* dpkg, ldd (optionally, to auto-infer dynamic lib dependencies during debian packaging, via [cargo-deb](https://github.com/mmstick/cargo-deb#installation))
* rpmbuild (for building rpms, via [cargo-rpm](https://github.com/iqlusioninc/cargo-rpm.git))

The setup here was tested successfully from linux (ubuntu) environments, but it should work well in other environments too, as long as the above requirements are met.

## Supported Targets

* x86_64-unknown-linux-gnu
* x86_64-alpine-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-alpine-linux-musl

For the list of targets used during project release, please refer to the [project Makefile](../Makefile).

## Supported Formats

* archive ([tar.gz](https://en.wikipedia.org/wiki/Tar_(computing)) for linux targets)
* deb ([Debian package](https://www.debian.org/doc/debian-policy/ch-binary.html))
* rpm ([RPM package](https://rpm.org/))
- archive ([tar.gz](<https://en.wikipedia.org/wiki/Tar_(computing)>) for linux targets)
- deb ([Debian package](https://www.debian.org/doc/debian-policy/ch-binary.html))
- rpm ([RPM package](https://rpm.org/))

For the list of formats used during project release (variable by target), please refer to the [project Makefile](../Makefile). A summary is given down below too.

## Release Compatibility

| Target | Format | Supported Platforms |
| -------| -------| --------------------|
| x86_64-unknown-linux-gnu | archive | Should work on linux systems with glibc (>=2.17), libstdc++, libatomic, libssl (==1.0.2) |
| x86_64-unknown-linux-gnu | deb | ~Debian jessie/stretch/buster as well as its derivatives like Ubuntu~ TODO |
| x86_64-unknown-linux-gnu | rpm | Centos7/8 |
| Target | Format | Supported Platforms |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| x86_64-unknown-linux-gnu | archive | Should work on linux systems with glibc (>=2.17), libstdc++, libatomic, libssl (==1.0.2) |
| x86_64-unknown-linux-gnu | deb | ~Debian jessie/stretch/buster as well as its derivatives like Ubuntu~ TODO |
| x86_64-unknown-linux-gnu | rpm | Centos7/8 |
| x86_64-alpine-linux-musl | archive | Should work on all linux systems but not as [performant](https://github.com/tremor-rs/tremor-runtime/issues/377) as the gnu releases |
24 changes: 24 additions & 0 deletions packaging/builder-images/publish_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# publish_images.sh
#
# Publish all the project builder docker images to docker hub
#
# Usage: ./publish_images.sh
# exit the script when a command fails
set -o errexit
# catch exit status for piped commands
set -o pipefail
RUST_TOOLCHAIN_FILE="./rust-toolchain"
RUST_VERSION=$(<"$RUST_TOOLCHAIN_FILE")
IMAGES=(
"tremor-builder:x86_64-unknown-linux-gnu"
"tremor-builder:x86_64-unknown-linux-gnu-${RUST_VERSION}"
"tremor-builder:x86_64-alpine-linux-musl"
"tremor-builder:x86_64-alpine-linux-musl-${RUST_VERSION}"
#"tremor-builder:x86_64-unknown-linux-musl"
#"tremor-builder:x86_64-unknown-linux-musl-${RUST_VERSION}"
)
for image in "${IMAGES[@]}"; do
docker push tremorproject/"$image"
done
1 change: 1 addition & 0 deletions packaging/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function package_rpm {
fi

echo "Creating rpm file in directory: ${PACKAGES_DIR}"
echo "$TARGET $PACKAGES_DIR"
cargo rpm build --verbose --no-cargo-build \
--target "$TARGET" \
--output "$PACKAGES_DIR"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.45.0
1.46.0
2 changes: 1 addition & 1 deletion src/sink/elastic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,6 @@ impl Sink for Elastic {
false
}
fn default_codec(&self) -> &str {
todo!()
"json"
}
}

0 comments on commit a0d9b06

Please sign in to comment.