Skip to content

Commit

Permalink
Merge branch 'main' into fix/copy_with_stop
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-rash authored Jan 7, 2025
2 parents f67be6f + cd6aa90 commit 95e721d
Show file tree
Hide file tree
Showing 55 changed files with 943 additions and 1,219 deletions.
75 changes: 23 additions & 52 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,61 +25,32 @@ tasks:
- protoc --proto_path=. --go_out=. --go_opt=paths=source_relative *.proto

all-code-gen:
deps: [gen-schema, proto]
deps: [gen-schema-api, proto]

gen-schema:
deps: [gen-schema-nodecontrol, gen-schema-agent]

gen-schema-agent:
dir: api/agent
gen-schema-api:
dir: api
cmds:
- go-jsonschema
--package=gen --tags json
--schema-package=https://github.com/synadia-io/nex/api/agent/register-agent-request=github.com/synadia-io/nex/agentapi/go/gen
--schema-output=https://github.com/synadia-io/nex/api/agent/register-agent-request=go/gen/register_agent_request.go
--schema-package=https://github.com/synadia-io/nex/api/agent/start-workload-request=github.com/synadia-io/nex/api/agent/go/gen
--schema-output=https://github.com/synadia-io/nex/api/agent/start-workload-request=go/gen/start_workload_request.go
--schema-package=https://github.com/synadia-io/nex/api/agent/stop-workload-request=github.com/synadia-io/nex/agentapi/go/gen
--schema-output=https://github.com/synadia-io/nex/api/agent/stop-workload-request=go/gen/stop_workload_request.go
*.json

gen-schema-nodecontrol:
dir: api/nodecontrol
cmds:
- go-jsonschema
--package=gen --tags json
--schema-package=io.nats.nex.v2.start_workload_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.start_workload_response=gen/start_workload_response.go
--schema-package=io.nats.nex.v2.stop_workload_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.stop_workload_response=gen/stop_workload_response.go
--schema-package=io.nats.nex.v2.stop_workload_request=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.stop_workload_request=gen/stop_workload_request.go
--schema-package=io.nats.nex.v2.node_info_request=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.node_info_request=gen/node_info_request.go
--schema-package=io.nats.nex.v2.node_info_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.node_info_response=gen/node_info_response.go
--schema-package=io.nats.nex.v2.lameduck_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.lameduck_response=gen/lameduck_response.go
--schema-package=io.nats.nex.v2.lameduck_request=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.lameduck_request=gen/lameduck_request.go
--schema-package=io.nats.nex.v2.workload_ping_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.workload_ping_response=gen/workload_ping_response.go
--schema-package=io.nats.nex.v2.agent_ping_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.agent_ping_response=gen/agent_ping_response.go
--schema-package=io.nats.nex.v2.node_ping_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.node_ping_response=gen/node_ping_response.go
--schema-package=io.nats.nex.v2.auction_request=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.auction_request=gen/auction_request.go
--schema-package=io.nats.nex.v2.auction_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.auction_response=gen/auction_response.go
--schema-package=io.nats.nex.v2.start_workload_request=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.start_workload_request=gen/start_workload_request.go
--schema-package=io.nats.nex.v2.clone_workload_request=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.clone_workload_request=gen/clone_workload_request.go
--schema-package=io.nats.nex.v2.clone_workload_response=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=io.nats.nex.v2.clone_workload_response=gen/clone_workload_response.go
--schema-package=shared=github.com/synadia-io/nex/api/nodecontrol/gen
--schema-output=shared=gen/shared.go
--package api --tags json
--schema-output=io.nats.nex.v2.agent_register_request=go/agent.go
--schema-output=io.nats.nex.v2.agent_register_response=go/agent.go
--schema-output=io.nats.nex.v2.agent_heartbeat=go/agent.go
--schema-output=io.nats.nex.v2.start_workload_request=go/shared.go
--schema-output=io.nats.nex.v2.start_workload_response=go/shared.go
--schema-output=io.nats.nex.v2.stop_workload_request=go/shared.go
--schema-output=io.nats.nex.v2.stop_workload_response=go/shared.go
--schema-output=io.nats.nex.v2.lameduck_request=go/shared.go
--schema-output=io.nats.nex.v2.lameduck_response=go/shared.go
--schema-output=io.nats.nex.v2.agent_ping_response=go/shared.go
--schema-output=io.nats.nex.v2.workload_ping_response=go/shared.go
--schema-output=shared=go/shared.go
--schema-output=io.nats.nex.v2.node_info_request=go/node.go
--schema-output=io.nats.nex.v2.node_info_response=go/node.go
--schema-output=io.nats.nex.v2.node_ping_response=go/node.go
--schema-output=io.nats.nex.v2.auction_request=go/node.go
--schema-output=io.nats.nex.v2.auction_response=go/node.go
--schema-output=io.nats.nex.v2.clone_workload_request=go/node.go
--schema-output=io.nats.nex.v2.clone_workload_response=go/node.go
*.json

nex:
Expand Down
File renamed without changes.
75 changes: 0 additions & 75 deletions api/agent/go/gen/start_workload_request.go

This file was deleted.

35 changes: 0 additions & 35 deletions api/agent/go/gen/stop_workload_request.go

This file was deleted.

55 changes: 0 additions & 55 deletions api/agent/start-workload-request.json

This file was deleted.

24 changes: 0 additions & 24 deletions api/agent/stop-workload-request.json

This file was deleted.

File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions api/nodecontrol/client.go → api/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nodecontrol
package api

import (
"encoding/json"
Expand All @@ -7,7 +7,7 @@ import (

"github.com/nats-io/nats.go"
"github.com/nats-io/nuid"
nodegen "github.com/synadia-io/nex/api/nodecontrol/gen"
nodegen "github.com/synadia-io/nex/api/go"
"github.com/synadia-io/nex/models"
)

Expand Down
12 changes: 6 additions & 6 deletions api/nodecontrol/client_test.go → api/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nodecontrol
package api

import (
"bytes"
Expand All @@ -17,7 +17,7 @@ import (
"github.com/nats-io/nats.go"
"github.com/nats-io/nkeys"

"github.com/synadia-io/nex/api/nodecontrol/gen"
gen "github.com/synadia-io/nex/api/go"
"github.com/synadia-io/nex/models"
"github.com/synadia-io/nex/test"
)
Expand Down Expand Up @@ -181,7 +181,7 @@ func TestAuctionDeployAndFindWorkload(t *testing.T) {
encEnv, err := tAKey.Seal(envB, auctionResp[0].TargetXkey)
be.NilErr(t, err)

binPath := test.BuildTestBinary(t, "../../test/testdata/forever/main.go", workingDir)
binPath := test.BuildTestBinary(t, "../test/testdata/forever/main.go", workingDir)

resp, err := control.AuctionDeployWorkload(models.NodeSystemNamespace, auctionResp[0].BidderId, gen.StartWorkloadRequestJson{
Description: "Test Workload",
Expand Down Expand Up @@ -253,7 +253,7 @@ func TestDirectDeployAndListWorkloads(t *testing.T) {
encEnv, err := tAKey.Seal(envB, test.Node1XkeyPublicKey)
be.NilErr(t, err)

binPath := test.BuildTestBinary(t, "../../test/testdata/forever/main.go", workingDir)
binPath := test.BuildTestBinary(t, "../test/testdata/forever/main.go", workingDir)

resp, err := control.DeployWorkload(models.NodeSystemNamespace, test.Node1ServerPublicKey, gen.StartWorkloadRequestJson{
Description: "Test Workload",
Expand Down Expand Up @@ -326,7 +326,7 @@ func TestUndeployWorkload(t *testing.T) {
encEnv, err := tAKey.Seal(envB, test.Node1XkeyPublicKey)
be.NilErr(t, err)

binPath := test.BuildTestBinary(t, "../../test/testdata/forever/main.go", workingDir)
binPath := test.BuildTestBinary(t, "../test/testdata/forever/main.go", workingDir)

resp, err := control.DeployWorkload(models.NodeSystemNamespace, test.Node1ServerPublicKey, gen.StartWorkloadRequestJson{
Description: "Test Workload",
Expand Down Expand Up @@ -485,7 +485,7 @@ func TestCopyWorkload(t *testing.T) {
encEnv, err := tAKey.Seal(envB, test.Node1XkeyPublicKey)
be.NilErr(t, err)

binPath := test.BuildTestBinary(t, "../../test/testdata/forever/main.go", workingDir)
binPath := test.BuildTestBinary(t, "../test/testdata/forever/main.go", workingDir)

resp, err := control.DeployWorkload(models.NodeSystemNamespace, test.Node1ServerPublicKey, gen.StartWorkloadRequestJson{
Description: "Test Workload",
Expand Down
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 95e721d

Please sign in to comment.