Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d17c86d
[raft/scd] Extract update and create opintent
MariemBaccari Aug 21, 2026
0c04bf8
[scd] Return conflict without error
MariemBaccari Sep 9, 2026
8fe495a
[raftstore] Rename actions packages to operations
MariemBaccari Aug 28, 2026
49b4f3a
[raftstore] Unexport operations
MariemBaccari Aug 28, 2026
e724a41
[raftstore] Rename context methods
MariemBaccari Aug 28, 2026
cf95e9c
[raftstore] Embed memstore and use checkpoint
MariemBaccari Aug 19, 2026
fb30ae4
[raft/scd] Implement constraints repo methods
MariemBaccari Aug 28, 2026
0bdb05b
[raft/scd] Implement subscriptions repo methods
MariemBaccari Aug 28, 2026
c7ec73d
[raft/scd] Implement operational intents repo methods
MariemBaccari Aug 28, 2026
d12d152
[raft/scd] Implement availability repo methods
MariemBaccari Aug 28, 2026
69ba1e7
[raft/rid] Implement ISA repo methods
MariemBaccari Aug 28, 2026
1abf559
[raft/rid] Implement subscriptions repo methods
MariemBaccari Aug 28, 2026
af323f4
[raft] Fix start action missing required context
the-glu Sep 11, 2026
1bbe0d9
[raft/rid] Extract InsertSubscription and route Create through the store
MariemBaccari Aug 31, 2026
30a2ff6
[raft/rid] Extract UpdateSubscription and route Update through the store
MariemBaccari Aug 31, 2026
6814f24
[raft/rid] Extract DeleteISA and route Delete through the store
MariemBaccari Aug 31, 2026
17a68f3
[raft/rid] Extract InsertISA and route Create through the store
MariemBaccari Aug 31, 2026
57cc09f
[raft/rid] Extract UpdateISA and route Update through the store
MariemBaccari Aug 31, 2026
16d9599
[raft/rid] Extract Get/Search and remove application layer
MariemBaccari Sep 15, 2026
af4ce63
[raft] Make raft runnable-locally
the-glu Jun 16, 2026
deaf0e5
[raftstore] Generate unique operation IDs
MariemBaccari Sep 15, 2026
7217ad0
[raft] Add tests in CI
the-glu Jun 22, 2026
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
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,41 @@ jobs:
- name: Bring down local DSS instance
run: make down-locally

dss-tests-with-raft:
name: DSS tests with Raft
runs-on: ubuntu-latest
env:
COMPOSE_PROFILES: with-raft
steps:
- name: Job information
run: |
echo "Job information"
echo "Trigger: ${{ github.event_name }}"
echo "Host: ${{ runner.os }}"
echo "Repository: ${{ github.repository }}"
echo "Branch: ${{ github.ref }}"
docker images
go env
- name: Checkout
uses: actions/checkout@v6
with:
submodules: true
- name: Build dss image
run: make build-dss
- name: Tear down any pre-existing local DSS instance
run: make down-locally
- name: Start local DSS instance
run: make start-locally
- name: Probe local DSS instance
run: make probe-locally
- name: Run Qualifier against local DSS instance
run: make qualify-locally
# Todo: Re add evict tests here once evict is implemented.
- name: Run security tests against local DSS instance
run: make security-locally
- name: Bring down local DSS instance
run: make down-locally

certificates-management-tests:
name: Certificate management tests
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ test-go-units-crdb: cleanup-test-go-units-crdb
go run ./cmds/db-manager/main.go migrate --schemas_dir ./build/db_schemas/scd --db_version latest --datastore_host localhost
go run ./cmds/db-manager/main.go migrate --schemas_dir ./build/db_schemas/aux_ --db_version latest --datastore_host localhost
go test -cover -count=1 -v ./pkg/rid/store/sqlstore --datastore_host localhost --datastore_port 26257 --datastore_ssl_mode disable --datastore_user root -test.gocoverdir=$(COVERDATA_DIR)
go test -cover -count=1 -v ./pkg/rid/application --datastore_host localhost --datastore_port 26257 --datastore_ssl_mode disable --datastore_user root -test.gocoverdir=$(COVERDATA_DIR)
go test -cover -count=1 -v ./pkg/scd/store/sqlstore --datastore_host localhost --datastore_port 26257 --datastore_ssl_mode disable --datastore_user root -test.gocoverdir=$(COVERDATA_DIR)
go test -cover -count=1 -v ./pkg/aux_/store/sqlstore --datastore_host localhost --datastore_port 26257 --datastore_ssl_mode disable --datastore_user root -test.gocoverdir=$(COVERDATA_DIR)
@docker stop dss-crdb-for-testing > /dev/null
Expand Down
4 changes: 3 additions & 1 deletion build/dev/docker-compose_dss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ services:
- $PWD/../test-certs:/var/test-certs:ro
- $PWD/startup/core_service.sh:/startup/core_service.sh:ro
- $PWD/startup/coverdata:/startup/coverdata:rw # we will save coverage info here
- raftdata:/raftdata
environment:
COMPOSE_PROFILES: ${COMPOSE_PROFILES}
# Note: requires the Dockerfile to have been built with "-cover" in the EXTRA_GO_INSTALL_FLAGS var
Expand Down Expand Up @@ -147,7 +148,7 @@ services:
interval: 3m
start_period: 30s
start_interval: 5s
profiles: ["", "with-yugabyte", "with-monitoring"]
profiles: ["", "with-yugabyte", "with-monitoring", "with-raft"]

local-dss-dummy-oauth:
build:
Expand Down Expand Up @@ -216,3 +217,4 @@ networks:

volumes:
local-dss-data:
raftdata:
9 changes: 7 additions & 2 deletions build/dev/startup/core_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ if [ "${COMPOSE_PROFILES#*"with-yugabyte"}" != "${COMPOSE_PROFILES}" ]; then
echo "Using Yugabyte"
DATASTORE_CONNECTION="-datastore_host local-dss-ybdb -datastore_user yugabyte --datastore_port 5433"
else
echo "Using CockroachDB"
DATASTORE_CONNECTION="-datastore_host local-dss-crdb"
if [ "${COMPOSE_PROFILES#*"with-raft"}" != "${COMPOSE_PROFILES}" ]; then
echo "Using raft"
DATASTORE_CONNECTION="-store_type raft -raft_node_id=1 -rid_raft_peers=1=http://127.0.0.1:9011 -scd_raft_peers=1=http://127.0.0.1:9021 -aux_raft_peers=1=http://127.0.0.1:9031 -raft_datadir /raftdata"
else
echo "Using CockroachDB"
DATASTORE_CONNECTION="-datastore_host local-dss-crdb"
fi
fi

if [ "${COMPOSE_PROFILES#*"with-monitoring"}" != "${COMPOSE_PROFILES}" ]; then
Expand Down
17 changes: 11 additions & 6 deletions cmds/core-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
requestlocality "github.com/interuss/dss/pkg/locality"
"github.com/interuss/dss/pkg/logging"
"github.com/interuss/dss/pkg/random"
"github.com/interuss/dss/pkg/rid/application"
rid_v1 "github.com/interuss/dss/pkg/rid/server/v1"
rid_v2 "github.com/interuss/dss/pkg/rid/server/v2"
rids "github.com/interuss/dss/pkg/rid/store"
Expand Down Expand Up @@ -112,6 +111,15 @@ func createAuxServer(ctx context.Context, locality string, publicEndpoint string
return nil, stacktrace.Propagate(err, "Unable to interact with store")
}

ctx = timestamp.NewContext(ctx, time.Now())

seed, err := random.NewSeed()
if err != nil {
return nil, stacktrace.Propagate(err, "Unable to generate seed")
}

ctx = random.NewContext(ctx, seed)

err = repo.SaveOwnMetadata(ctx, locality, publicEndpoint)

if err != nil {
Expand Down Expand Up @@ -141,15 +149,12 @@ func createRIDServers(ctx context.Context, locality string, logger *zap.Logger)
}
}

app := application.NewFromTransactor(ridStore, logger)
return &rid_v1.Server{
Store: ridStore,
App: app,
Locality: locality,
AllowHTTPBaseUrls: *allowHTTPBaseUrls,
}, &rid_v2.Server{
Store: ridStore,
App: app,
Locality: locality,
AllowHTTPBaseUrls: *allowHTTPBaseUrls,
}, nil
Expand Down Expand Up @@ -368,9 +373,9 @@ func RunHTTPServer(ctx context.Context, ctxCanceler func(), address, locality st
handler = authorizer.TokenMiddleware(handler)
handler = http.TimeoutHandler(handler, *timeout, "request timeout")
handler = logging.HTTPMiddleware(logger, *dumpRequests, handler)
handler = timestamp.RequestTimestampMiddleware(handler)
handler = timestamp.Middleware(handler)
handler = random.Middleware(handler)
handler = requestlocality.LocalityMiddleware(locality)(handler)
handler = requestlocality.Middleware(locality)(handler)

if *enableMetrics || *enableTracing {
// We use the default settings; the APIRouter handler will override the span value accordingly, as it has more information.
Expand Down
2 changes: 1 addition & 1 deletion cmds/dummy-oauth/api/dummyoauth/interface.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type GetTokenRequest struct {
Auth api.AuthorizationResult
}

const GetTokenOperationID = "GetToken"
const GetTokenOperationID = "dummyoauth.GetToken"

func (request *GetTokenRequest) OperationID() string { return GetTokenOperationID }

Expand Down
20 changes: 10 additions & 10 deletions interfaces/openapi-to-go-server/example/api/rid/interface.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type SearchIdentificationServiceAreasRequest struct {
Auth api.AuthorizationResult
}

const SearchIdentificationServiceAreasOperationID = "SearchIdentificationServiceAreas"
const SearchIdentificationServiceAreasOperationID = "rid.SearchIdentificationServiceAreas"

func (request *SearchIdentificationServiceAreasRequest) OperationID() string {
return SearchIdentificationServiceAreasOperationID
Expand Down Expand Up @@ -112,7 +112,7 @@ type GetIdentificationServiceAreaRequest struct {
Auth api.AuthorizationResult
}

const GetIdentificationServiceAreaOperationID = "GetIdentificationServiceArea"
const GetIdentificationServiceAreaOperationID = "rid.GetIdentificationServiceArea"

func (request *GetIdentificationServiceAreaRequest) OperationID() string {
return GetIdentificationServiceAreaOperationID
Expand Down Expand Up @@ -152,7 +152,7 @@ type CreateIdentificationServiceAreaRequest struct {
Auth api.AuthorizationResult
}

const CreateIdentificationServiceAreaOperationID = "CreateIdentificationServiceArea"
const CreateIdentificationServiceAreaOperationID = "rid.CreateIdentificationServiceArea"

func (request *CreateIdentificationServiceAreaRequest) OperationID() string {
return CreateIdentificationServiceAreaOperationID
Expand Down Expand Up @@ -200,7 +200,7 @@ type UpdateIdentificationServiceAreaRequest struct {
Auth api.AuthorizationResult
}

const UpdateIdentificationServiceAreaOperationID = "UpdateIdentificationServiceArea"
const UpdateIdentificationServiceAreaOperationID = "rid.UpdateIdentificationServiceArea"

func (request *UpdateIdentificationServiceAreaRequest) OperationID() string {
return UpdateIdentificationServiceAreaOperationID
Expand Down Expand Up @@ -242,7 +242,7 @@ type DeleteIdentificationServiceAreaRequest struct {
Auth api.AuthorizationResult
}

const DeleteIdentificationServiceAreaOperationID = "DeleteIdentificationServiceArea"
const DeleteIdentificationServiceAreaOperationID = "rid.DeleteIdentificationServiceArea"

func (request *DeleteIdentificationServiceAreaRequest) OperationID() string {
return DeleteIdentificationServiceAreaOperationID
Expand Down Expand Up @@ -281,7 +281,7 @@ type SearchSubscriptionsRequest struct {
Auth api.AuthorizationResult
}

const SearchSubscriptionsOperationID = "SearchSubscriptions"
const SearchSubscriptionsOperationID = "rid.SearchSubscriptions"

func (request *SearchSubscriptionsRequest) OperationID() string {
return SearchSubscriptionsOperationID
Expand Down Expand Up @@ -315,7 +315,7 @@ type GetSubscriptionRequest struct {
Auth api.AuthorizationResult
}

const GetSubscriptionOperationID = "GetSubscription"
const GetSubscriptionOperationID = "rid.GetSubscription"

func (request *GetSubscriptionRequest) OperationID() string { return GetSubscriptionOperationID }

Expand Down Expand Up @@ -353,7 +353,7 @@ type CreateSubscriptionRequest struct {
Auth api.AuthorizationResult
}

const CreateSubscriptionOperationID = "CreateSubscription"
const CreateSubscriptionOperationID = "rid.CreateSubscription"

func (request *CreateSubscriptionRequest) OperationID() string { return CreateSubscriptionOperationID }

Expand Down Expand Up @@ -400,7 +400,7 @@ type UpdateSubscriptionRequest struct {
Auth api.AuthorizationResult
}

const UpdateSubscriptionOperationID = "UpdateSubscription"
const UpdateSubscriptionOperationID = "rid.UpdateSubscription"

func (request *UpdateSubscriptionRequest) OperationID() string { return UpdateSubscriptionOperationID }

Expand Down Expand Up @@ -441,7 +441,7 @@ type DeleteSubscriptionRequest struct {
Auth api.AuthorizationResult
}

const DeleteSubscriptionOperationID = "DeleteSubscription"
const DeleteSubscriptionOperationID = "rid.DeleteSubscription"

func (request *DeleteSubscriptionRequest) OperationID() string { return DeleteSubscriptionOperationID }

Expand Down
Loading
Loading