-
Notifications
You must be signed in to change notification settings - Fork 5
feat: fastly compute service to perform assignments (FF-3552) #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
a813273
feat: fastly compute service to perform assignments (FF-3552)
leoromanovsky e985863
convert from reqwest blocking to non-blocking to conform to wasm target
leoromanovsky c8717ee
remove vscode settings
leoromanovsky 5956e65
makefile for local development
leoromanovsky a3f37c7
split into multiple handlers
leoromanovsky 48d47aa
its a thing of beauty
leoromanovsky 56e5c96
coming along nicely
leoromanovsky 3a4b644
good
leoromanovsky 59cb251
local test kv-store!
leoromanovsky a159065
feat: add `get_subject_assignments` method to eppo_core to compute al…
leoromanovsky 6e704ef
simplify unnecessary ownership transfer
leoromanovsky bccce04
e2e evaluation
leoromanovsky c338d31
remove space end of filename
leoromanovsky ff73c47
Revert "feat: add `get_subject_assignments` method to eppo_core to co…
leoromanovsky 48d2ebc
tidy up error logging
leoromanovsky 3b55f6d
Merge branch 'main' into lr/ff-3552/edge-function
leoromanovsky 3219a03
edge function dep on 4.1.1
leoromanovsky d288696
generate token hash
leoromanovsky be2d5ac
fastly local
leoromanovsky 9f99865
conform to desired API
leoromanovsky 78fe3b5
add CORS support
leoromanovsky f156caa
Merge branch 'main' into lr/ff-3552/edge-function
leoromanovsky f2f27af
version from cargo
leoromanovsky f1bcf3d
use Datetime
leoromanovsky 4ada237
String
leoromanovsky 8101988
no copy
leoromanovsky 50ed0ec
use VariationType
leoromanovsky 38f71eb
move structs to core
leoromanovsky 266de8a
extra logging
leoromanovsky c3c90f8
refactor FlagAssignment to model
leoromanovsky b9ca60a
use Str
leoromanovsky 26300db
build responses in core
leoromanovsky 26c4466
tidy
leoromanovsky 7b4eb91
add format
leoromanovsky 95219d4
str
leoromanovsky 81d1f55
format
leoromanovsky 9622a21
one more format
leoromanovsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,47 @@ | ||
# Make settings - @see https://tech.davis-hansson.com/p/make/ | ||
SHELL := bash | ||
.ONESHELL: | ||
.SHELLFLAGS := -eu -o pipefail -c | ||
.DELETE_ON_ERROR: | ||
MAKEFLAGS += --warn-undefined-variables | ||
MAKEFLAGS += --no-builtin-rules | ||
|
||
# Log levels | ||
DEBUG := $(shell printf "\e[2D\e[35m") | ||
INFO := $(shell printf "\e[2D\e[36m🔵 ") | ||
OK := $(shell printf "\e[2D\e[32m🟢 ") | ||
WARN := $(shell printf "\e[2D\e[33m🟡 ") | ||
ERROR := $(shell printf "\e[2D\e[31m🔴 ") | ||
END := $(shell printf "\e[0m") | ||
WASM_TARGET=wasm32-wasi | ||
FASTLY_PACKAGE=fastly-edge-assignments | ||
BUILD_DIR=target/$(WASM_TARGET)/release | ||
WASM_FILE=$(BUILD_DIR)/$(FASTLY_PACKAGE).wasm | ||
|
||
.PHONY: default | ||
default: help | ||
|
||
## help - Print help message. | ||
# Help target for easy documentation | ||
.PHONY: help | ||
help: Makefile | ||
@echo "usage: make <target>" | ||
@sed -n 's/^##//p' $< | ||
help: | ||
@echo "Available targets:" | ||
@echo " all - Default target (build workspace)" | ||
@echo " workspace-build - Build the entire workspace excluding the Fastly package" | ||
@echo " workspace-test - Test the entire workspace excluding the Fastly package" | ||
@echo " fastly-edge-assignments-build - Build only the Fastly package for WASM" | ||
@echo " fastly-edge-assignments-test - Test only the Fastly package" | ||
@echo " clean - Clean all build artifacts" | ||
|
||
.PHONY: test | ||
test: ${testDataDir} | ||
npm test | ||
|
||
# Build the entire workspace excluding the `fastly-edge-assignments` package | ||
.PHONY: workspace-build | ||
workspace-build: | ||
cargo build --workspace --exclude $(FASTLY_PACKAGE) | ||
|
||
# Run tests for the entire workspace excluding the `fastly-edge-assignments` package | ||
.PHONY: workspace-test | ||
workspace-test: | ||
cargo test --workspace --exclude $(FASTLY_PACKAGE) | ||
|
||
# Build only the `fastly-edge-assignments` package for WASM | ||
.PHONY: fastly-edge-assignments-build | ||
fastly-edge-assignments-build: | ||
rustup target add $(WASM_TARGET) | ||
cargo build --release --target $(WASM_TARGET) --package $(FASTLY_PACKAGE) | ||
|
||
# Test only the `fastly-edge-assignments` package | ||
.PHONY: fastly-edge-assignments-test | ||
fastly-edge-assignments-test: | ||
cargo test --target $(WASM_TARGET) --package $(FASTLY_PACKAGE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[build] | ||
target = "wasm32-wasi" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pkg/ | ||
bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "fastly-edge-assignments" | ||
version = "0.1.0" | ||
edition = "2021" | ||
# Remove this line if you want to be able to publish this crate as open source on crates.io. | ||
# Otherwise, `publish = false` prevents an accidental `cargo publish` from revealing private source. | ||
publish = false | ||
|
||
[dependencies] | ||
chrono = "0.4.19" | ||
eppo_core = { version = "=4.1.0", path = "../eppo_core" } | ||
fastly = "0.11.0" | ||
serde_json = "1.0.132" | ||
serde = "1.0.192" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Eppo Assignments on Fastly Compute@Edge | ||
|
||
TODO: Add a description |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes helpful? I got tired of putting the various parameters in the right place.