Compare commits

..

No commits in common. "main" and "wit-wasmcloud-wadm-v0.2.0" have entirely different histories.

20 changed files with 547 additions and 852 deletions

6
.github/release.yml vendored
View File

@ -1,6 +0,0 @@
# .github/release.yml
changelog:
exclude:
authors:
- dependabot

View File

@ -30,13 +30,13 @@ jobs:
git fetch origin main:main
- name: Set up Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: ${{ env.HELM_VERSION }}
# Used by helm chart-testing below
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.12.2'
@ -82,7 +82,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: ${{ env.HELM_VERSION }}
@ -91,7 +91,7 @@ jobs:
helm package charts/wadm -d .helm-charts
- name: Login to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}

View File

@ -27,7 +27,7 @@ jobs:
components: clippy, rustfmt
# Cache: rust
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
- uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
key: 'ubuntu-22.04-rust-cache'
@ -47,7 +47,7 @@ jobs:
# if the previous step fails, upload logs
- name: Upload logs for debugging
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: ${{ failure() && steps.test.outcome == 'failure' }}
with:
name: e2e-logs-${{ matrix.test }}

View File

@ -78,7 +78,7 @@ jobs:
run: echo "version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
- name: Install Zig
uses: mlugg/setup-zig@7dccf5e6d09267c55f815f2db29495f30ba2ebca # v2.0.1
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: 0.13.0
@ -90,7 +90,7 @@ jobs:
target: ${{ matrix.config.target }}
- name: Install cargo zigbuild
uses: taiki-e/install-action@cfe1303741c2e620e5f7daa667105e0da1316db9 # v2.53.0
uses: taiki-e/install-action@510b3ecd7915856b6909305605afa7a8a57c1b04 # v2.48.1
with:
tool: cargo-zigbuild
@ -98,7 +98,7 @@ jobs:
run: |
${{ matrix.config.buildCommand }} --release --bin wadm --target ${{ matrix.config.target }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: wadm-${{ env.RELEASE_VERSION }}-${{ matrix.config.uploadArtifactSuffix }}
if-no-files-found: error
@ -116,7 +116,7 @@ jobs:
RELEASE_VERSION: ${{ needs.build.outputs.version_output }}
steps:
- name: Download release assets
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
- name: Prepare release
run: |
@ -128,7 +128,7 @@ jobs:
done
- name: Create github release
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
@ -188,12 +188,12 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: ./artifacts
pattern: '*linux*'
@ -210,7 +210,7 @@ jobs:
done
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@ -226,7 +226,7 @@ jobs:
echo "RELEASE_VERSION_DOCKER_TAG=${RELEASE_VERSION#v}" >> $GITHUB_ENV
- name: Build and push (tag)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
push: true
@ -241,7 +241,7 @@ jobs:
ghcr.io/${{ env.OWNER }}/wadm:${{ env.RELEASE_VERSION_DOCKER_TAG }}
- name: Build and push wolfi (tag)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
push: true
@ -257,7 +257,7 @@ jobs:
ghcr.io/${{ env.OWNER }}/wadm:${{ env.RELEASE_VERSION_DOCKER_TAG }}-wolfi
- name: Build and push (main)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
if: ${{ github.ref == 'refs/heads/main' }}
with:
push: true
@ -269,7 +269,7 @@ jobs:
tags: ghcr.io/${{ env.OWNER }}/wadm:canary
- name: Build and push (main)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
if: ${{ github.ref == 'refs/heads/main' }}
with:
push: true

View File

@ -37,7 +37,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v3.pre.node20
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v3.pre.node20
with:
name: SARIF file
path: results.sarif
@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
sarif_file: results.sarif

View File

@ -27,7 +27,7 @@ jobs:
components: clippy, rustfmt
# Cache: rust
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
- uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
key: '${{ matrix.os }}-rust-cache'
@ -41,7 +41,7 @@ jobs:
fi
- name: install wash
uses: taiki-e/install-action@cfe1303741c2e620e5f7daa667105e0da1316db9 # v2.53.0
uses: taiki-e/install-action@510b3ecd7915856b6909305605afa7a8a57c1b04 # v2.48.1
with:
tool: wash@0.38.0

View File

@ -41,7 +41,7 @@ jobs:
cp wit/wadm/*.wit release/wit/
tar cvzf ${{ steps.ctx.outputs.tarball }} -C release wit
- name: Release
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
with:
files: ${{ steps.ctx.outputs.tarball }}
make_latest: "false"

1233
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ repository = "https://github.com/wasmcloud/wadm"
default-run = "wadm"
[workspace.package]
version = "0.21.0"
version = "0.20.1"
[features]
default = []
@ -42,21 +42,21 @@ wadm-types = { workspace = true }
[workspace.dependencies]
anyhow = "1"
async-nats = "0.39"
async-nats = "0.36"
async-trait = "0.1"
bytes = "1"
chrono = "0.4"
clap = { version = "4", features = ["derive", "cargo", "env"] }
cloudevents-sdk = "0.8"
cloudevents-sdk = "0.7"
futures = "0.3"
http = { version = "1", default-features = false }
http-body-util = { version = "0.1", default-features = false }
hyper = { version = "1", default-features = false }
hyper-util = { version = "0.1", default-features = false }
indexmap = { version = "2", features = ["serde"] }
jsonschema = "0.29"
jsonschema = "0.17"
lazy_static = "1"
nkeys = "0.4.5"
nkeys = "0.4.4"
# One version back to avoid clashes with 0.10 of otlp
opentelemetry = { version = "0.17", features = ["rt-tokio"] }
# 0.10 to avoid protoc dep
@ -64,7 +64,7 @@ opentelemetry-otlp = { version = "0.10", features = [
"http-proto",
"reqwest-client",
] }
rand = { version = "0.9", features = ["small_rng"] }
rand = { version = "0.8", features = ["small_rng"] }
# NOTE(thomastaylor312): Pinning this temporarily to 1.10 due to transitive dependency with oci
# crates that are pinned to 1.10
regex = "~1.10"
@ -73,7 +73,7 @@ semver = { version = "1.0.25", features = ["serde"] }
serde = "1"
serde_json = "1"
serde_yaml = "0.9"
sha2 = "0.10.9"
sha2 = "0.10.2"
thiserror = "2"
tokio = { version = "1", default-features = false }
tracing = { version = "0.1", features = ["log"] }
@ -83,10 +83,10 @@ tracing-subscriber = { version = "0.3.7", features = ["env-filter", "json"] }
ulid = { version = "1", features = ["serde"] }
utoipa = "5"
uuid = "1"
wadm = { version = "0.21", path = "./crates/wadm" }
wadm-client = { version = "0.10", path = "./crates/wadm-client" }
wadm-types = { version = "0.8", path = "./crates/wadm-types" }
wasmcloud-control-interface = "2.4.0"
wadm = { version = "0.20.1", path = "./crates/wadm" }
wadm-client = { version = "0.8.1", path = "./crates/wadm-client" }
wadm-types = { version = "0.8.1", path = "./crates/wadm-types" }
wasmcloud-control-interface = { version = "2.3.0" }
wasmcloud-secrets-types = "0.5.0"
wit-bindgen-wrpc = { version = "0.9", default-features = false }
wit-bindgen = { version = "0.36.0", default-features = false }
@ -102,7 +102,7 @@ serial_test = "3"
wadm-client = { workspace = true }
wadm-types = { workspace = true }
wasmcloud-control-interface = { workspace = true }
testcontainers = "0.24"
testcontainers = "0.23"
[build-dependencies]
schemars = { workspace = true }

View File

@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: '0.2.10'
version: "0.2.8"
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 'v0.21.0'
appVersion: "v0.17.0"

View File

@ -36,15 +36,10 @@ Common labels
{{- define "wadm.labels" -}}
helm.sh/chart: {{ include "wadm.chart" . }}
{{ include "wadm.selectorLabels" . }}
app.kubernetes.io/component: wadm
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: wadm
{{- with .Values.additionalLabels }}
{{ . | toYaml }}
{{- end }}
{{- end }}
{{/*
@ -103,4 +98,4 @@ volumes:
path: "nats.creds"
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -34,9 +34,6 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
additionalLabels: {}
# app: wadm
serviceAccount:
# Specifies whether a service account should be created
create: true

View File

@ -1,7 +1,7 @@
[package]
name = "wadm-client"
description = "A client library for interacting with the wadm API"
version = "0.10.0"
version = "0.8.1"
edition = "2021"
authors = ["wasmCloud Team"]
keywords = ["webassembly", "wasmcloud", "wadm"]

View File

@ -1,7 +1,7 @@
[package]
name = "wadm-types"
description = "Types and validators for the wadm API"
version = "0.8.3"
version = "0.8.1"
edition = "2021"
authors = ["wasmCloud Team"]
keywords = ["webassembly", "wasmcloud", "wadm"]
@ -12,12 +12,12 @@ repository = "https://github.com/wasmcloud/wadm"
wit = []
[dependencies]
anyhow = { workspace = true }
regex = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
anyhow = { workspace = true }
regex = { workspace = true }
schemars = { workspace = true }
utoipa = { workspace = true }
[target.'cfg(not(target_family = "wasm"))'.dependencies]

View File

@ -697,21 +697,16 @@ pub fn validate_component_properties(application: &Manifest) -> Vec<ValidationFa
/// Validates link configs in a WADM application manifest.
///
/// At present this can check for:
/// - all configs that declare `properties` have unique names
/// (configs without properties refer to existing configs)
/// - all config names are unique
///
pub fn validate_link_configs(manifest: &Manifest) -> Vec<ValidationFailure> {
let mut failures = Vec::new();
let mut link_config_names = HashSet::new();
for link_trait in manifest.links() {
if let TraitProperty::Link(LinkProperty { target, source, .. }) = &link_trait.properties {
for config in &target.config {
// we only need to check for uniqueness of configs with properties
if config.properties.is_none() {
continue;
}
for config in target.config.iter() {
// Check if config name is unique
if !link_config_names.insert(config.name.clone()) {
if !link_config_names.insert((config.name.clone(),)) {
failures.push(ValidationFailure::new(
ValidationFailureLevel::Error,
format!("Duplicate link config name found: '{}'", config.name),
@ -720,13 +715,9 @@ pub fn validate_link_configs(manifest: &Manifest) -> Vec<ValidationFailure> {
}
if let Some(source) = source {
for config in &source.config {
// we only need to check for uniqueness of configs with properties
if config.properties.is_none() {
continue;
}
for config in source.config.iter() {
// Check if config name is unique
if !link_config_names.insert(config.name.clone()) {
if !link_config_names.insert((config.name.clone(),)) {
failures.push(ValidationFailure::new(
ValidationFailureLevel::Error,
format!("Duplicate link config name found: '{}'", config.name),

View File

@ -7,7 +7,6 @@ use tokio::sync::RwLock;
use tracing::{instrument, trace};
use wadm_types::{api::StatusInfo, Spread, SpreadScalerProperty, TraitProperty};
use crate::events::ConfigSet;
use crate::scaler::spreadscaler::{
compute_ineligible_hosts, eligible_hosts, spreadscaler_annotations,
};
@ -120,9 +119,6 @@ impl<S: ReadStore + Send + Sync + Clone> Scaler for ComponentDaemonScaler<S> {
Ok(Vec::new())
}
}
Event::ConfigSet(ConfigSet { config_name }) if self.config.contains(config_name) => {
self.reconcile().await
}
// No other event impacts the job of this scaler so we can ignore it
_ => Ok(Vec::new()),
}

View File

@ -9,8 +9,8 @@ use wadm_types::{api::StatusInfo, Spread, SpreadScalerProperty, TraitProperty};
use crate::commands::StopProvider;
use crate::events::{
ConfigSet, HostHeartbeat, ProviderHealthCheckFailed, ProviderHealthCheckInfo,
ProviderHealthCheckPassed, ProviderInfo, ProviderStarted, ProviderStopped,
HostHeartbeat, ProviderHealthCheckFailed, ProviderHealthCheckInfo, ProviderHealthCheckPassed,
ProviderInfo, ProviderStarted, ProviderStopped,
};
use crate::scaler::compute_id_sha256;
use crate::scaler::spreadscaler::{
@ -156,11 +156,6 @@ impl<S: ReadStore + Send + Sync + Clone> Scaler for ProviderDaemonScaler<S> {
// only status needs update no new commands required
Ok(Vec::new())
}
Event::ConfigSet(ConfigSet { config_name })
if self.config.provider_config.contains(config_name) =>
{
self.reconcile().await
}
// No other event impacts the job of this scaler so we can ignore it
_ => Ok(Vec::new()),
}

View File

@ -10,7 +10,7 @@ use wadm_types::{
api::StatusInfo, Spread, SpreadScalerProperty, TraitProperty, DEFAULT_SPREAD_WEIGHT,
};
use crate::events::{ConfigSet, HostHeartbeat};
use crate::events::HostHeartbeat;
use crate::{
commands::{Command, ScaleComponent},
events::{Event, HostStarted, HostStopped},
@ -114,9 +114,6 @@ impl<S: ReadStore + Send + Sync + Clone> Scaler for ComponentSpreadScaler<S> {
Ok(Vec::new())
}
}
Event::ConfigSet(ConfigSet { config_name }) if self.config.contains(config_name) => {
self.reconcile().await
}
// No other event impacts the job of this scaler so we can ignore it
_ => Ok(Vec::new()),
}

View File

@ -15,7 +15,7 @@ use wadm_types::{
use crate::{
commands::{Command, StartProvider, StopProvider},
events::{
ConfigSet, Event, HostHeartbeat, HostStarted, HostStopped, ProviderHealthCheckFailed,
Event, HostHeartbeat, HostStarted, HostStopped, ProviderHealthCheckFailed,
ProviderHealthCheckInfo, ProviderHealthCheckPassed, ProviderInfo, ProviderStarted,
ProviderStopped,
},
@ -173,11 +173,6 @@ impl<S: ReadStore + Send + Sync + Clone> Scaler for ProviderSpreadScaler<S> {
// only status needs update no new commands required
Ok(Vec::new())
}
Event::ConfigSet(ConfigSet { config_name })
if self.config.provider_config.contains(config_name) =>
{
self.reconcile().await
}
// No other event impacts the job of this scaler so we can ignore it
_ => Ok(Vec::new()),
}

View File

@ -20,11 +20,6 @@ spec:
name: kvredis
config:
- name: redis-url
properties:
url: "redis://127.0.0.1:6379"
# this config name is duplicated, but has no properties,
# so it references an existing config
- name: my_example_app-shared_redis
- name: userinfo2
type: component
@ -40,11 +35,6 @@ spec:
name: kvredis
config:
- name: redis-url
properties:
url: "redis://127.0.0.1:6379"
# this config name is duplicated, but has no properties,
# so it references an existing config
- name: my_example_app-shared_redis
- name: webcap1
type: capability
@ -62,14 +52,8 @@ spec:
source:
config:
- name: default-port
properties:
port: 0.0.0.0:8080
- name: alternate-port
properties:
address: 0.0.0.0:8081
- name: alternate-port
properties:
address: 0.0.0.0:8081
- name: webcap2
type: capability
@ -87,8 +71,6 @@ spec:
source:
config:
- name: default-port
properties:
address: 0.0.0.0:8080
- name: kvredis
type: capability