Skip to content

Commit

Permalink
feat: Add smdk install support in CLI and release (#2648)
Browse files Browse the repository at this point in the history
Closes #2644 

Adds a name check to `fluvio install`.
If it starts with `fluvio-`, it is an extension and gets installed in the channel extension dir. Otherwise, it gets installed in the fluvio bin dir.

The result of `fluvio install smdk --develop` installs the latest published `smdk` to install in my fluvio path.

--

Added `smdk` to CI for build and publish for CI

Moving a lot of publish and release workflows into Makefile so I can test it easier locally

Got rid of the `cargo make` configs since they are out of date and unmaintained
  • Loading branch information
tjtelan committed Oct 7, 2022
1 parent 737e330 commit ef7846d
Show file tree
Hide file tree
Showing 43 changed files with 620 additions and 818 deletions.
96 changes: 73 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Build platform and run smoke test
name: CI

permissions:
contents: read
permissions: read-all
#permissions:
# contents: read

concurrency:
group: ci-${{ github.ref }}
Expand Down Expand Up @@ -31,6 +32,7 @@ env:
AUTH_FILE: crates/fluvio-sc/test-data/auth_config/policy.json
X509_SCOPE_FILE: crates/fluvio-sc/test-data/auth_config/scopes.json
FLV_CLUSTER_PROVISION_TIMEOUT: 600
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
# this job set up dynamic configuration shared among jobs
Expand Down Expand Up @@ -60,7 +62,7 @@ jobs:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
rust: [stable]
binary: [fluvio, fluvio-run, fluvio-test, fluvio-channel,smdk]
binary: [fluvio, fluvio-run, fluvio-test, fluvio-channel, smdk]
os: [ubuntu-latest]
env:
RUST_BACKTRACE: full
Expand Down Expand Up @@ -104,8 +106,8 @@ jobs:
run: make build-channel

- name: Build smdk
if: matrix.binary == 'sdmk'
run: make smdk
if: matrix.binary == 'smdk'
run: make build-smdk

# Upload artifacts
- name: Upload artifact - ${{ matrix.binary }}
Expand All @@ -121,7 +123,7 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
# fail-fast: false
matrix:
rust-target:
- aarch64-apple-darwin
Expand All @@ -130,6 +132,14 @@ jobs:
- x86_64-apple-darwin
rust: [stable]
binary: [fluvio]
exclude:
# Currently unsupported by cranelift-codegen v0.88.1
- rust-target: arm-unknown-linux-gnueabihf
binary: smdk
- rust-target: armv7-unknown-linux-gnueabihf
binary: smdk
- rust-target: x86_64-pc-windows-gnu
binary: smdk.exe
include:
- os: ubuntu-latest
rust: stable
Expand Down Expand Up @@ -181,6 +191,15 @@ jobs:
rust-target: aarch64-apple-darwin
binary: fluvio-channel

- os: macos-12
rust: stable
rust-target: x86_64-apple-darwin
binary: smdk
- os: macos-12
rust: stable
rust-target: aarch64-apple-darwin
binary: smdk

env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
Expand Down Expand Up @@ -217,7 +236,7 @@ jobs:
- name: Install Helm for Mac
run: brew install helm
if: matrix.binary == 'fluvio' && matrix.os == 'macos-12'

- name: Build fluvio
timeout-minutes: 30
if: matrix.binary == 'fluvio'
Expand All @@ -227,7 +246,7 @@ jobs:
if: matrix.rust-target == 'x86_64-pc-windows-gnu'
run: sudo apt-get install gcc-mingw-w64-x86-64

- name: Build fluvio
- name: Build fluvio.exe
timeout-minutes: 30
if: matrix.binary == 'fluvio.exe'
run: make build-cli-minimal
Expand All @@ -242,11 +261,21 @@ jobs:
if: matrix.binary == 'fluvio-channel'
run: make build-channel

- name: Build fluvio-channel
- name: Build fluvio-channel.exe
timeout-minutes: 30
if: matrix.binary == 'fluvio-channel.exe'
run: make build-channel

- name: Build smdk
timeout-minutes: 30
if: matrix.binary == 'smdk'
run: make build-smdk

- name: Build smdk.exe
timeout-minutes: 30
if: matrix.binary == 'smdk.exe'
run: make build-smdk

# Upload artifacts
- name: Upload artifact - ${{ matrix.binary }}
uses: actions/upload-artifact@v3
Expand All @@ -266,7 +295,17 @@ jobs:
os: [ubuntu-latest]
rust: [stable]
rust-target: [x86_64-unknown-linux-gnu]
check: [fmt, clippy, doc, doc-test, test, crate-version, crate-audit, crate-publish-check]
check:
[
fmt,
clippy,
doc,
doc-test,
test,
crate-version,
crate-audit,
crate-publish-check,
]
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
Expand Down Expand Up @@ -302,7 +341,7 @@ jobs:
- name: Crate version check
if: matrix.check == 'crate-version'
run: cargo run --manifest-path release-tools/check-crate-version/Cargo.toml -- --crates-dir crates --publish-list-path release-tools/check-crate-version/publish-list.toml
- name: Audit crate licenses + advisories
- name: Audit crate licenses + advisories
if: matrix.check == 'crate-audit'
continue-on-error: true
uses: EmbarkStudios/cargo-deny-action@v1
Expand Down Expand Up @@ -339,7 +378,6 @@ jobs:
- name: Integration test
run: make run-integration-test


build_smartmodule:
name: Build SmartModule
runs-on: ${{ matrix.os }}
Expand All @@ -363,7 +401,6 @@ jobs:
- name: Build Regex SmartModule
run: make -C smartmodule/sm-regex


check_wasm:
name: Build WASM crates (${{ matrix.wasm-crate }})
needs: config
Expand Down Expand Up @@ -444,6 +481,7 @@ jobs:
- fluvio
- fluvio-cli
- fluvio-channel
#- smartmodule-development-kit
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
Expand Down Expand Up @@ -597,7 +635,6 @@ jobs:
name: local-${{ matrix.run }}-${{ matrix.test }}-diag
path: diagnostics*.gz
retention-days: 1


build_image:
name: Build Fluvio Docker image
Expand Down Expand Up @@ -651,7 +688,13 @@ jobs:
os: [ubuntu-latest]
rust-target: [x86_64-unknown-linux-musl]
run: [r1]
test: [smoke-test-k8, smoke-test-k8-tls, smoke-test-k8-tls-root-unclean, stats-test]
test:
[
smoke-test-k8,
smoke-test-k8-tls,
smoke-test-k8-tls-root-unclean,
stats-test,
]
k8: [k3d, minikube]
spu: [3]
steps:
Expand Down Expand Up @@ -793,7 +836,7 @@ jobs:
run: docker image save infinyon/fluvio:${{ github.sha }} --output /tmp/infinyon-fluvio.tar

- name: Run upgrade test with CI artifacts
timeout-minutes: 10
timeout-minutes: 10
env:
TEST_DATA_BYTES: 10000
run: |
Expand Down Expand Up @@ -1047,8 +1090,8 @@ jobs:
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Login GH CLI
run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
#- name: Login GH CLI
# run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
- name: Delete old release
run: gh release delete -R infinyon/fluvio dev -y || true
- name: Bump dev tag
Expand All @@ -1067,8 +1110,8 @@ jobs:
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Login GH CLI
run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
#- name: Login GH CLI
# run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
- name: package helm
run: make helm_pkg
- name: Publish artifact
Expand All @@ -1091,7 +1134,14 @@ jobs:
- arm-unknown-linux-gnueabihf
- x86_64-apple-darwin
- x86_64-unknown-linux-musl
artifact: [fluvio, fluvio-channel]
artifact: [fluvio, fluvio-channel, smdk]
exclude:
- rust-target: armv7-unknown-linux-gnueabihf
artifact: smdk
- rust-target: arm-unknown-linux-gnueabihf
artifact: smdk
- rust-target: x86_64-pc-windows-gnu
artifact: smdk.exe
include:
- rust-target: x86_64-unknown-linux-musl
artifact: fluvio-run
Expand All @@ -1107,8 +1157,8 @@ jobs:
artifact: fluvio-test
permissions: write-all
steps:
- name: Login GH CLI
run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
#- name: Login GH CLI
# run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
- name: Download artifact
uses: actions/download-artifact@v3
with:
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ concurrency:

on:
schedule:
- cron: '0 * * * *'
# pull_request:
# branches: [master]
- cron: "0 * * * *"
# pull_request:
# branches: [master]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
K3D_VERSION: v5.4.1
FLV_CLUSTER_PROVISION_TIMEOUT: 600


jobs:

build_long_binaries:
name: Test buiild for ${{ matrix.binary }} on (${{ matrix.os }})
if: ${{ false }}
Expand Down Expand Up @@ -74,20 +72,19 @@ jobs:
name: ${{ matrix.binary }}-${{ matrix.rust-target }}
path: ${{ env.RUST_BIN_DIR }}/${{ matrix.binary }}


longevity:
name: Hourly Longevity test
name: Hourly Longevity test
runs-on: ${{ matrix.os }}
# needs:
# - build_long_binaries
# needs:
# - build_long_binaries
timeout-minutes: 120
strategy:
fail-fast: false
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-target: [x86_64-unknown-linux-musl]
run: [r1]
# run: [r1,r2,r3,r4,r5,r6,r7,r8,r9]
# run: [r1,r2,r3,r4,r5,r6,r7,r8,r9]
binary: [dev]

test_run_time: [30m]
Expand All @@ -97,7 +94,7 @@ jobs:
producer_linger_ms: [10]
consumer: [1, 25]
topic: [1, 10]
topic_segment_bytes: [500000] # 500KB
topic_segment_bytes: [500000] # 500KB
topic_retention: [15s]
env:
TEST_BINARY: fluvio-test-x86_64-unknown-linux-musl
Expand All @@ -106,15 +103,15 @@ jobs:
- uses: actions/checkout@v3

- name: Login GH CLI
# if: ${{ false }}
# if: ${{ false }}
run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})

- name: Download dev release
# if: ${{ false }}
# if: ${{ false }}
run: gh release download dev -R infinyon/fluvio -D /tmp/release

- name: Unpack fluvio-test from dev release
# if: ${{ false }}
# if: ${{ false }}
run: |
cd /tmp/release; unzip ${{ env.TEST_BINARY }}.zip; chmod +x fluvio-test
echo "/tmp/release" >> $GITHUB_PATH
Expand Down Expand Up @@ -194,8 +191,8 @@ jobs:
--topic ${{ matrix.topic }} \
--topic-segment-size ${{ matrix.topic_segment_bytes }} \
--topic-retention ${{ matrix.topic_retention }} \
longevity
longevity
## If the test passed, then copy the data from cluster to store into artifacts
#- name: Export data from the cluster for caching
# run: |
Expand All @@ -216,7 +213,7 @@ jobs:
## TODO: Add a shorter cache time
#- uses: actions/upload-artifact@v3
# with:
# name: 'longevity-data'
# name: 'longevity-data'
# path: longevity-data.tar
# retention-days: 5
- name: Run diagnostics
Expand All @@ -235,8 +232,7 @@ jobs:
if: ${{ !success() }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
fields: repo,message,commit,author,action,eventName,ref,workflow,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}

Loading

0 comments on commit ef7846d

Please sign in to comment.