From 80bbd03de3a4296e173b7d953315a4f155471c65 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Thu, 13 Feb 2025 21:14:11 +0100
Subject: [PATCH 01/19] feat: initial dir test
Signed-off-by: Peter Balogh
---
.../agntcy-dir/components/helm/Chart.yaml | 29 +++++
.../agntcy-dir/components/helm/values.yaml | 0
integrations/agntcy-dir/examples/.gitkeep | 0
integrations/agntcy-dir/manifests/.gitkeep | 0
.../agntcy-dir/tests/compiler_test.go | 107 ++++++++++++++++++
.../agntcy-dir/tests/push_agent_test.go | 88 ++++++++++++++
integrations/agntcy-dir/tests/suite_test.go | 13 +++
7 files changed, 237 insertions(+)
create mode 100644 integrations/agntcy-dir/components/helm/Chart.yaml
create mode 100644 integrations/agntcy-dir/components/helm/values.yaml
create mode 100644 integrations/agntcy-dir/examples/.gitkeep
create mode 100644 integrations/agntcy-dir/manifests/.gitkeep
create mode 100644 integrations/agntcy-dir/tests/compiler_test.go
create mode 100644 integrations/agntcy-dir/tests/push_agent_test.go
create mode 100644 integrations/agntcy-dir/tests/suite_test.go
diff --git a/integrations/agntcy-dir/components/helm/Chart.yaml b/integrations/agntcy-dir/components/helm/Chart.yaml
new file mode 100644
index 00000000..87fab990
--- /dev/null
+++ b/integrations/agntcy-dir/components/helm/Chart.yaml
@@ -0,0 +1,29 @@
+apiVersion: v2
+name: agntcy-dir
+description: A Helm chart for Kubernetes
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+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.1.0
+
+# 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: "1.16.0"
+
+dependencies:
+ - name: dir
+ version: v0.0.1
+ repository: oci://ghcr.io/agntcy/dir/helm-charts
diff --git a/integrations/agntcy-dir/components/helm/values.yaml b/integrations/agntcy-dir/components/helm/values.yaml
new file mode 100644
index 00000000..e69de29b
diff --git a/integrations/agntcy-dir/examples/.gitkeep b/integrations/agntcy-dir/examples/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/integrations/agntcy-dir/manifests/.gitkeep b/integrations/agntcy-dir/manifests/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/integrations/agntcy-dir/tests/compiler_test.go b/integrations/agntcy-dir/tests/compiler_test.go
new file mode 100644
index 00000000..bbead004
--- /dev/null
+++ b/integrations/agntcy-dir/tests/compiler_test.go
@@ -0,0 +1,107 @@
+package tests
+
+import (
+ "encoding/json"
+ "fmt"
+ "os"
+ "path/filepath"
+
+ "github.com/google/go-cmp/cmp"
+ ginkgo "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+
+ "github.com/agntcy/csit/integrations/testutils"
+)
+
+var _ = ginkgo.Describe("Phoenix compiler tests", func() {
+ var (
+ tempAgentPath string
+ dockerImage string
+ mountDest string
+ mountString string
+ expectedAgentModelFile string
+ )
+
+ ginkgo.BeforeEach(func() {
+ examplesDir := "../examples/"
+ marketingStrategyPath, err := filepath.Abs(filepath.Join(examplesDir, "marketing-strategy"))
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ tempAgentPath = filepath.Join(os.TempDir(), "agent.json")
+
+ dockerImage = fmt.Sprintf("%s/dir-ctl:%s", os.Getenv("IMAGE_REPO"), os.Getenv("DIRECTORY_IMAGE_TAG"))
+ mountDest = "/opt/marketing-strategy"
+ mountString = fmt.Sprintf("%s:%s", marketingStrategyPath, mountDest)
+
+ expectedAgentModelFile = filepath.Join(marketingStrategyPath, "expected_agent.json")
+ })
+
+ ginkgo.Context("agent compilation", func() {
+ ginkgo.It("should compile an agent", func() {
+
+ dirctlArgs := []string{
+ "build",
+ "--name=marketing-strategy",
+ "--version=v1.0.0",
+ "--artifact-type=docker-image",
+ "--artifact-url=http://ghcr.io/agntcy/marketing-strategy",
+ "--author=author1",
+ "--author=author2",
+ mountDest,
+ }
+
+ runner := testutils.NewDockerRunner(dockerImage, mountString, nil)
+ outputBuffer, err := runner.Run(dirctlArgs...)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
+
+ err = os.WriteFile(tempAgentPath, outputBuffer.Bytes(), 0644)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+ })
+
+ ginkgo.It("agent model should be the expected", func() {
+ var expected, compiled map[string]any
+
+ expactedModelJSON, err := os.ReadFile(expectedAgentModelFile)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ // Unmarshal or Decode the JSON to the interface.
+ err = json.Unmarshal([]byte(expactedModelJSON), &expected)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ compiledModelJSON, err := os.ReadFile(tempAgentPath)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ // Unmarshal or Decode the JSON to the interface.
+ err = json.Unmarshal([]byte(compiledModelJSON), &compiled)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ // Filter "created_at" and "security.signature" fields
+ filter := cmp.FilterPath(func(p cmp.Path) bool {
+ // Ensure the path is deep enough
+ if len(p) >= 7 {
+ parentStep := p[len(p)-3]
+ currentStep := p[len(p)-1]
+ if mapStep, ok := p[len(p)-7].(cmp.MapIndex); ok {
+ if key, ok := mapStep.Key().Interface().(string); ok && key == "extensions" {
+ // Check if the parentStep is a map lookup with key "specs"
+ if parentMapIndex, ok := parentStep.(cmp.MapIndex); ok {
+ if parentKey, ok := parentMapIndex.Key().Interface().(string); ok && parentKey == "specs" {
+ // Check if the currentStep is a map lookup with key "created_at" and "signature"
+ if currentMapIndex, ok := currentStep.(cmp.MapIndex); ok {
+ if currentKey, ok := currentMapIndex.Key().Interface().(string); ok && (currentKey == "created_at" || currentKey == "signature") {
+ return true // Ignore these paths
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false // Include all other paths
+ }, cmp.Ignore())
+
+ // Check the compiled agent model without extensions field
+ gomega.Expect(expected).To(gomega.BeComparableTo(compiled, filter))
+ })
+ })
+})
diff --git a/integrations/agntcy-dir/tests/push_agent_test.go b/integrations/agntcy-dir/tests/push_agent_test.go
new file mode 100644
index 00000000..7f005687
--- /dev/null
+++ b/integrations/agntcy-dir/tests/push_agent_test.go
@@ -0,0 +1,88 @@
+package tests
+
+import (
+ "encoding/json"
+ "fmt"
+ "os"
+ "path/filepath"
+ "runtime"
+
+ ginkgo "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+
+ "github.com/agntcy/csit/integrations/testutils"
+)
+
+var _ = ginkgo.Describe("Phoenix agent push tests", func() {
+ var (
+ dockerImage string
+ mountDest string
+ mountString string
+ agentModelFile string
+ agentID string
+ )
+
+ ginkgo.BeforeEach(func() {
+ examplesDir := "../examples/"
+ marketingStrategyPath, err := filepath.Abs(filepath.Join(examplesDir, "marketing-strategy"))
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ dockerImage = fmt.Sprintf("%s/dir-ctl:%s", os.Getenv("IMAGE_REPO"), os.Getenv("DIRECTORY_IMAGE_TAG"))
+ mountDest = "/opt/marketing-strategy"
+ mountString = fmt.Sprintf("%s:%s", marketingStrategyPath, mountDest)
+ agentModelFile = filepath.Join(mountDest, "expected_agent.json")
+ })
+
+ ginkgo.Context("agent push and pull", func() {
+ ginkgo.It("should push an agent", func() {
+
+ dirctlArgs := []string{
+ "push",
+ "--from-file",
+ agentModelFile,
+ }
+
+ if runtime.GOOS != "linux" {
+ dirctlArgs = append(dirctlArgs,
+ "--server-addr",
+ "host.docker.internal:8888",
+ )
+ }
+
+ runner := testutils.NewDockerRunner(dockerImage, mountString, nil)
+ outputBuffer, err := runner.Run(dirctlArgs...)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
+
+ var response map[string]any
+
+ // Unmarshal or Decode the JSON to the interface.
+ err = json.Unmarshal(outputBuffer.Bytes(), &response)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
+
+ _, err = fmt.Fprintf(ginkgo.GinkgoWriter, "agentID: %v\n", response["id"])
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ agentID = fmt.Sprintf("%v", response["id"])
+ })
+
+ ginkgo.It("should pull an agent", func() {
+
+ dirctlArgs := []string{
+ "pull",
+ "--id",
+ agentID,
+ }
+
+ if runtime.GOOS != "linux" {
+ dirctlArgs = append(dirctlArgs,
+ "--server-addr",
+ "host.docker.internal:8888",
+ )
+ }
+
+ runner := testutils.NewDockerRunner(dockerImage, mountString, nil)
+ outputBuffer, err := runner.Run(dirctlArgs...)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
+ })
+ })
+})
diff --git a/integrations/agntcy-dir/tests/suite_test.go b/integrations/agntcy-dir/tests/suite_test.go
new file mode 100644
index 00000000..5f2ea8f3
--- /dev/null
+++ b/integrations/agntcy-dir/tests/suite_test.go
@@ -0,0 +1,13 @@
+package tests
+
+import (
+ "testing"
+
+ ginkgo "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/gomega"
+)
+
+func TestTests(t *testing.T) {
+ gomega.RegisterFailHandler(ginkgo.Fail)
+ ginkgo.RunSpecs(t, "Tests Suite")
+}
From 3f9ba0d7a46d83723b208bdb3c7d22fce27f0fe4 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 06:50:53 +0100
Subject: [PATCH 02/19] chore: add github.com:agntcy/dir/e2e/testdata/ to
integrations/agntcy-dir/examples/dir as a submodule
Signed-off-by: Peter Balogh
---
.gitmodules | 3 +++
integrations/agntcy-dir/examples/dir | 1 +
2 files changed, 4 insertions(+)
create mode 100644 .gitmodules
create mode 160000 integrations/agntcy-dir/examples/dir
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..200ad818
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "integrations/agntcy-dir/examples/dir"]
+ path = integrations/agntcy-dir/examples/dir
+ url = git@github.com:agntcy/dir.git
diff --git a/integrations/agntcy-dir/examples/dir b/integrations/agntcy-dir/examples/dir
new file mode 160000
index 00000000..616b5ce5
--- /dev/null
+++ b/integrations/agntcy-dir/examples/dir
@@ -0,0 +1 @@
+Subproject commit 616b5ce57244db92568ce0b3c85a12f3b36f837c
From 8a43799a8d942e342afd5387246b951813f63d34 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 07:32:42 +0100
Subject: [PATCH 03/19] chore: update testadata
Signed-off-by: Peter Balogh
---
integrations/agntcy-dir/examples/.gitkeep | 0
.../examples/testdata/expected_agent.json | 62 +++++++++++++++++++
.../agntcy-dir/tests/compiler_test.go | 8 ++-
.../agntcy-dir/tests/push_agent_test.go | 7 ++-
4 files changed, 71 insertions(+), 6 deletions(-)
delete mode 100644 integrations/agntcy-dir/examples/.gitkeep
create mode 100644 integrations/agntcy-dir/examples/testdata/expected_agent.json
diff --git a/integrations/agntcy-dir/examples/.gitkeep b/integrations/agntcy-dir/examples/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/integrations/agntcy-dir/examples/testdata/expected_agent.json b/integrations/agntcy-dir/examples/testdata/expected_agent.json
new file mode 100644
index 00000000..48a535fa
--- /dev/null
+++ b/integrations/agntcy-dir/examples/testdata/expected_agent.json
@@ -0,0 +1,62 @@
+{
+ "name": "marketing-strategy",
+ "version": "v1.0.0",
+ "artifact_url": "http://ghcr.io/cisco-agents/marketing-strategy",
+ "artifact_type": "docker-image",
+ "extensions": [
+ {
+ "name": "base",
+ "version": "v0.0.0",
+ "specs": {
+ "authors": "[author1, author2]",
+ "created_at": "2025-01-22T12:08:31Z"
+ }
+ },
+ {
+ "name": "runtime",
+ "version": "v0.0.0",
+ "specs": {
+ "language": "python",
+ "sbom": "{\"name\":\"marketing-strategy\",\"packages\":[{\"name\":\"crewai\",\"version\":\"0.55.2\"},{\"name\":\"langchain\",\"version\":\"0.2.16\"},{\"name\":\"langchain-ollama\",\"version\":\"0.1.3\"},{\"name\":\"langchain-openai\",\"version\":\"0.1.25\"},{\"name\":\"langgraph\",\"version\":\"0.2.34\"}]}",
+ "version": "\u003e=3.11,\u003c3.13"
+ }
+ },
+ {
+ "name": "category",
+ "version": "v0.0.0",
+ "specs": {
+ "categories": "[]"
+ }
+ },
+ {
+ "name": "crewai",
+ "version": "v0.0.0",
+ "specs": {
+ "agent.chief_marketing_strategist.backstory": "You are the Chief Marketing Strategist at a leading digital marketing agency, known for crafting bespoke strategies that drive success.\n",
+ "agent.chief_marketing_strategist.goal": "Synthesize amazing insights from product analysis to formulate incredible marketing strategies.\n",
+ "agent.chief_marketing_strategist.role": "Chief Marketing Strategist\n",
+ "agent.creative_content_creator.backstory": "As a Creative Content Creator at a top-tier digital marketing agency, you excel in crafting narratives that resonate with audiences. Your expertise lies in turning marketing strategies into engaging stories and visual content that capture attention and inspire action.\n",
+ "agent.creative_content_creator.goal": "Develop compelling and innovative content for social media campaigns, with a focus on creating high-impact ad copies.\n",
+ "agent.creative_content_creator.role": "Creative Content Creator\n",
+ "agent.lead_market_analyst.backstory": "As the Lead Market Analyst at a premier digital marketing firm, you specialize in dissecting online business landscapes.\n",
+ "agent.lead_market_analyst.goal": "Conduct amazing analysis of the products and competitors, providing in-depth insights to guide marketing strategies.\n",
+ "agent.lead_market_analyst.role": "Lead Market Analyst\n",
+ "inputs.campaign_idea_task": "string",
+ "inputs.copy_creation_task": "string",
+ "inputs.marketing_strategy_task": "string",
+ "inputs.project_understanding_task": "string",
+ "inputs.research_task": "string",
+ "task.campaign_idea_task.description": "Develop creative marketing campaign ideas for {project_description}. Ensure the ideas are innovative, engaging, and aligned with the overall marketing strategy.\n",
+ "task.campaign_idea_task.expected_output": "A list of 5 campaign ideas, each with a brief description and expected impact.\n",
+ "task.copy_creation_task.description": "Create marketing copies based on the approved campaign ideas for {project_description}. Ensure the copies are compelling, clear, and tailored to the target audience.\n",
+ "task.copy_creation_task.expected_output": "Marketing copies for each campaign idea.\n",
+ "task.marketing_strategy_task.description": "Formulate a comprehensive marketing strategy for the project {project_description} of the customer {customer_domain}. Use the insights from the research task and the project understanding task to create a high-quality strategy.\n",
+ "task.marketing_strategy_task.expected_output": "A detailed marketing strategy document that outlines the goals, target audience, key messages, and proposed tactics, make sure to have name, tatics, channels and KPIs",
+ "task.project_understanding_task.description": "Understand the project details and the target audience for {project_description}. Review any provided materials and gather additional information as needed.\n",
+ "task.project_understanding_task.expected_output": "A detailed summary of the project and a profile of the target audience.\n",
+ "task.research_task.description": "Conduct a thorough research about the customer and competitors in the context of {customer_domain}. Make sure you find any interesting and relevant information given the current year is 2024. We are working with them on the following project: {project_description}.\n",
+ "task.research_task.expected_output": "A complete report on the customer and their customers and competitors, including their demographics, preferences, market positioning and audience engagement.\n"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/integrations/agntcy-dir/tests/compiler_test.go b/integrations/agntcy-dir/tests/compiler_test.go
index bbead004..02549670 100644
--- a/integrations/agntcy-dir/tests/compiler_test.go
+++ b/integrations/agntcy-dir/tests/compiler_test.go
@@ -24,16 +24,18 @@ var _ = ginkgo.Describe("Phoenix compiler tests", func() {
ginkgo.BeforeEach(func() {
examplesDir := "../examples/"
- marketingStrategyPath, err := filepath.Abs(filepath.Join(examplesDir, "marketing-strategy"))
+ marketingStrategyPath, err := filepath.Abs(filepath.Join(examplesDir, "dir/e2e/testdata/marketing-strategy"))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
tempAgentPath = filepath.Join(os.TempDir(), "agent.json")
-
dockerImage = fmt.Sprintf("%s/dir-ctl:%s", os.Getenv("IMAGE_REPO"), os.Getenv("DIRECTORY_IMAGE_TAG"))
mountDest = "/opt/marketing-strategy"
mountString = fmt.Sprintf("%s:%s", marketingStrategyPath, mountDest)
- expectedAgentModelFile = filepath.Join(marketingStrategyPath, "expected_agent.json")
+ testdataDir, err := filepath.Abs(filepath.Join(examplesDir, "destdata"))
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
+ expectedAgentModelFile = filepath.Join(testdataDir, "expected_agent.json")
})
ginkgo.Context("agent compilation", func() {
diff --git a/integrations/agntcy-dir/tests/push_agent_test.go b/integrations/agntcy-dir/tests/push_agent_test.go
index 7f005687..e661fd90 100644
--- a/integrations/agntcy-dir/tests/push_agent_test.go
+++ b/integrations/agntcy-dir/tests/push_agent_test.go
@@ -24,12 +24,13 @@ var _ = ginkgo.Describe("Phoenix agent push tests", func() {
ginkgo.BeforeEach(func() {
examplesDir := "../examples/"
- marketingStrategyPath, err := filepath.Abs(filepath.Join(examplesDir, "marketing-strategy"))
+ testDataDir, err := filepath.Abs(filepath.Join(examplesDir, "testdata"))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
dockerImage = fmt.Sprintf("%s/dir-ctl:%s", os.Getenv("IMAGE_REPO"), os.Getenv("DIRECTORY_IMAGE_TAG"))
- mountDest = "/opt/marketing-strategy"
- mountString = fmt.Sprintf("%s:%s", marketingStrategyPath, mountDest)
+ mountDest = "/opt/testdata"
+ mountString = fmt.Sprintf("%s:%s", testDataDir, mountDest)
+
agentModelFile = filepath.Join(mountDest, "expected_agent.json")
})
From 8ff614b62886f4d1724742f92fca11b3fcb53b3b Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 07:34:30 +0100
Subject: [PATCH 04/19] chore: run go mod tidy
Signed-off-by: Peter Balogh
---
integrations/go.mod | 23 ++++----------------
integrations/go.sum | 51 ++-------------------------------------------
2 files changed, 6 insertions(+), 68 deletions(-)
diff --git a/integrations/go.mod b/integrations/go.mod
index aa32fe12..66c1d279 100644
--- a/integrations/go.mod
+++ b/integrations/go.mod
@@ -3,38 +3,23 @@ module github.com/agntcy/csit/integrations
go 1.23.3
require (
+ github.com/google/go-cmp v0.6.0
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.0
- github.com/spf13/viper v1.19.0
- github.com/stretchr/testify v1.10.0
)
require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
- github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
- github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
- github.com/hashicorp/hcl v1.0.0 // indirect
- github.com/magiconair/properties v1.8.7 // indirect
- github.com/mitchellh/mapstructure v1.5.0 // indirect
- github.com/pelletier/go-toml/v2 v2.2.2 // indirect
+ github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
- github.com/sagikazarmark/locafero v0.4.0 // indirect
- github.com/sagikazarmark/slog-shim v0.1.0 // indirect
- github.com/sourcegraph/conc v0.3.0 // indirect
- github.com/spf13/afero v1.11.0 // indirect
- github.com/spf13/cast v1.6.0 // indirect
- github.com/spf13/pflag v1.0.5 // indirect
- github.com/subosito/gotenv v1.6.0 // indirect
- go.uber.org/atomic v1.9.0 // indirect
- go.uber.org/multierr v1.9.0 // indirect
- golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
+ github.com/stretchr/testify v1.10.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/tools v0.26.0 // indirect
- gopkg.in/ini.v1 v1.67.0 // indirect
+ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/integrations/go.sum b/integrations/go.sum
index 20b32617..94a59337 100644
--- a/integrations/go.sum
+++ b/integrations/go.sum
@@ -1,11 +1,6 @@
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
-github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
-github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
-github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
@@ -14,60 +9,21 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
-github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
-github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
-github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
-github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
-github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/gomega v1.36.0 h1:Pb12RlruUtj4XUuPUqeEWc6j5DkVVVA49Uf6YLfC95Y=
github.com/onsi/gomega v1.36.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
-github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
-github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
-github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
-github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
-github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
-github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
-github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
-github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
-github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
-github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
-github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
-github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
-github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
-github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
-github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
-github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
-github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
-go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
-go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
-go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
-golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
-golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
@@ -81,8 +37,5 @@ google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
-gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
From 13b17a476fecd3505f72c8c5d41479e633ee5f7e Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 07:53:13 +0100
Subject: [PATCH 05/19] feat: add initial dir tests to Taskfile
Signed-off-by: Peter Balogh
---
integrations/Taskfile.yaml | 64 ++++++++++++++++++-
.../agntcy-agp/components/helm/Chart.yaml | 2 +-
.../agntcy-dir/components/helm/Chart.yaml | 4 +-
.../agntcy-dir/components/helm/values.yaml | 2 +
.../agntcy-dir/tests/compiler_test.go | 2 +-
.../agntcy-dir/tests/push_agent_test.go | 2 +-
6 files changed, 70 insertions(+), 6 deletions(-)
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index 8bd6c2e6..2794e32a 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -12,6 +12,7 @@ vars:
## Image config
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
GATEWAY_IMAGE_TAG: '{{ .GATEWAY_IMAGE_TAG | default "0.1.0-rc0-10-g794c425" }}'
+ DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "616b5ce57244db92568ce0b3c85a12f3b36f837c" }}'
IMAGE_BAKE_OPTS: '{{ .IMAGE_BAKE_OPTS | default "--set *.platform=linux/arm64" }}'
TEST_APP_TAG: '{{ .TEST_APP_TAG | default "v0.0.1" }}'
@@ -43,8 +44,22 @@ tasks:
cmds:
# pull images
- docker pull {{.IMAGE_REPO}}/agp/gw:{{.GATEWAY_IMAGE_TAG}}
+ - docker pull {{.IMAGE_REPO}}/dir/dir-apiserver:{{.DIRECTORY_IMAGE_TAG}}
+
# load images
- kind load docker-image {{.IMAGE_REPO}}/agp/gw:{{.GATEWAY_IMAGE_TAG}} --name {{.KIND_CLUSTER_NAME}}
+ - kind load docker-image {{.IMAGE_REPO}}/dir/dir-apiserver:{{.DIRECTORY_IMAGE_TAG}} --name {{.KIND_CLUSTER_NAME}}
+
+ k8s:port-forward:setup:directory:
+ internal: true
+ cmds:
+ - kubectl port-forward svc/agntcy-dir -n {{ .HELM_NAMESPACE }} 8888 &
+ - sleep 1
+
+ k8s:port-forward:teardown:directory:
+ internal: true
+ cmds:
+ - kill -9 $(ps aux | grep port-forward | grep agntcy-dir | awk '{print $2}') || true
k8s:port-forward:setup:gateway:
internal: true
@@ -57,8 +72,33 @@ tasks:
cmds:
- kill -9 $(ps aux | grep port-forward | grep agntcy-agp | awk '{print $2}') || true
+ test:env:directory:deploy:
+ desc: Deploy Agntcy directory test env
+ vars:
+ REGCRED_CREATE: '{{ .REGCRED_CREATE | default "false" }}'
+ cmds:
+ - |
+ helm dependency build ./agntcy-dir/components/helm
+ helm upgrade agntcy-dir \
+ ./agntcy-dir/components/helm \
+ --set dir.apiserver.image.tag="{{ .DIRECTORY_IMAGE_TAG }}" \
+ --set regcred.create="{{ .REGCRED_CREATE }}" \
+ --set dir.apiserver.config.ipfs_api_address="http:/agntcy-dir-ipfs.{{ .HELM_NAMESPACE }}.svc.cluster.local:10125" \
+ --set global.fallbackDefaults.pvcSize="1Gi" \
+ --namespace {{ .HELM_NAMESPACE }} \
+ --create-namespace \
+ --install \
+ --wait \
+ --wait-for-jobs \
+ --timeout "15m"
+
+ test:env:directory:cleanup:
+ desc: Remove agntcy directory test env
+ cmds:
+ - helm delete --namespace {{ .HELM_NAMESPACE }} agntcy-dir
+
test:env:gateway:deploy:
- desc: Deploy agent gateway test env
+ desc: Deploy agntcy gateway test env
deps:
- kind:load-images
cmds:
@@ -85,6 +125,28 @@ tasks:
cmds:
- IMAGE_TAG={{ .TEST_APP_TAG }} docker buildx bake {{ .IMAGE_BAKE_OPTS }} --load
+ test:directory:
+ desc: Directory test
+ cmds:
+ - task: k8s:port-forward:setup
+ - defer: { task: k8s:port-forward:teardown }
+ - defer: { task: manifests:cleanup }
+ - IMAGE_REPO={{.IMAGE_REPO}} DIRECTORY_IMAGE_TAG={{.DIRECTORY_IMAGE_TAG}} go test ./agntcy-dir/tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 30m -timeout 30m -ginkgo.v
+
+ test:directory:compiler:
+ desc: Agntcy compiler test
+ cmds:
+ - docker pull {{.IMAGE_REPO}}/dir/dir-ctl:{{.DIRECTORY_IMAGE_TAG}}
+ - IMAGE_REPO={{.IMAGE_REPO}} DIRECTORY_IMAGE_TAG={{.DIRECTORY_IMAGE_TAG}} go test ./agntcy-dir/tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 10m -timeout 10m -ginkgo.v -ginkgo.focus "agent compilation"
+
+ test:directory:push:
+ desc: Directory agent push test
+ cmds:
+ - task: k8s:port-forward:setup
+ - defer: { task: k8s:port-forward:teardown }
+ - defer: { task: manifests:cleanup }
+ - IMAGE_REPO={{.IMAGE_REPO}} DIRECTORY_IMAGE_TAG={{.DIRECTORY_IMAGE_TAG}} go test ./agntcy-dir/tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 30m -timeout 30m -ginkgo.v -ginkgo.focus "agent push and pull"
+
test:autogen-agent:run:
internal: true
cmds:
diff --git a/integrations/agntcy-agp/components/helm/Chart.yaml b/integrations/agntcy-agp/components/helm/Chart.yaml
index 7ef6aa66..4203be33 100644
--- a/integrations/agntcy-agp/components/helm/Chart.yaml
+++ b/integrations/agntcy-agp/components/helm/Chart.yaml
@@ -24,7 +24,7 @@ version: 0.1.0
# 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: "1.16.0"
+appVersion: "0.1.0"
dependencies:
- name: agp
diff --git a/integrations/agntcy-dir/components/helm/Chart.yaml b/integrations/agntcy-dir/components/helm/Chart.yaml
index 87fab990..f2b5cf22 100644
--- a/integrations/agntcy-dir/components/helm/Chart.yaml
+++ b/integrations/agntcy-dir/components/helm/Chart.yaml
@@ -21,9 +21,9 @@ version: 0.1.0
# 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: "1.16.0"
+appVersion: "0.1.0"
dependencies:
- name: dir
- version: v0.0.1
+ version: "v0.1.0"
repository: oci://ghcr.io/agntcy/dir/helm-charts
diff --git a/integrations/agntcy-dir/components/helm/values.yaml b/integrations/agntcy-dir/components/helm/values.yaml
index e69de29b..d1870a62 100644
--- a/integrations/agntcy-dir/components/helm/values.yaml
+++ b/integrations/agntcy-dir/components/helm/values.yaml
@@ -0,0 +1,2 @@
+regcred:
+ create: false
diff --git a/integrations/agntcy-dir/tests/compiler_test.go b/integrations/agntcy-dir/tests/compiler_test.go
index 02549670..cf7b598b 100644
--- a/integrations/agntcy-dir/tests/compiler_test.go
+++ b/integrations/agntcy-dir/tests/compiler_test.go
@@ -13,7 +13,7 @@ import (
"github.com/agntcy/csit/integrations/testutils"
)
-var _ = ginkgo.Describe("Phoenix compiler tests", func() {
+var _ = ginkgo.Describe("Agntcy compiler tests", func() {
var (
tempAgentPath string
dockerImage string
diff --git a/integrations/agntcy-dir/tests/push_agent_test.go b/integrations/agntcy-dir/tests/push_agent_test.go
index e661fd90..ca170ae5 100644
--- a/integrations/agntcy-dir/tests/push_agent_test.go
+++ b/integrations/agntcy-dir/tests/push_agent_test.go
@@ -13,7 +13,7 @@ import (
"github.com/agntcy/csit/integrations/testutils"
)
-var _ = ginkgo.Describe("Phoenix agent push tests", func() {
+var _ = ginkgo.Describe("Agntcy agent push tests", func() {
var (
dockerImage string
mountDest string
From 5b17454604b2b4bdf8254c721796de40d7298379 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 07:56:50 +0100
Subject: [PATCH 06/19] test: add dir test to GitHub actions
Signed-off-by: Peter Balogh
---
.github/workflows/test-integrations.yaml | 51 ++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/.github/workflows/test-integrations.yaml b/.github/workflows/test-integrations.yaml
index 69de9e8f..a70f8821 100644
--- a/.github/workflows/test-integrations.yaml
+++ b/.github/workflows/test-integrations.yaml
@@ -76,3 +76,54 @@ jobs:
cd integrations
task test:gateway
shell: bash
+
+ run-tests-directory:
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: 'read'
+ id-token: 'write'
+ packages: 'read'
+ attestations: 'read'
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Setup Environment
+ uses: ./.github/actions/setup-env
+ with:
+ python: true
+ go: false
+
+ - name: Setup K8S Tools
+ uses: ./.github/actions/setup-k8s
+ with:
+ kind-version: ${{ inputs.kind-version }}
+
+ - name: Create kind cluster
+ run: |
+ cd integrations
+ task kind:create
+ shell: bash
+
+ - name: Deploy agntcy dir
+ run: |
+ cd integrations
+ task test:env:directory:deploy
+ shell: bash
+
+ - name: Run simple directory tests
+ run: |
+ cd integrations
+ task test:directory
+ shell: bash
From f588fa06ca7880e49e6f169f226f385ba9307051 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 08:03:36 +0100
Subject: [PATCH 07/19] chore: add license headers
Signed-off-by: Peter Balogh
---
integrations/agntcy-dir/components/helm/Chart.yaml | 3 +++
integrations/agntcy-dir/components/helm/values.yaml | 3 +++
integrations/agntcy-dir/tests/compiler_test.go | 3 +++
integrations/agntcy-dir/tests/push_agent_test.go | 3 +++
integrations/agntcy-dir/tests/suite_test.go | 3 +++
5 files changed, 15 insertions(+)
diff --git a/integrations/agntcy-dir/components/helm/Chart.yaml b/integrations/agntcy-dir/components/helm/Chart.yaml
index f2b5cf22..fe74cba0 100644
--- a/integrations/agntcy-dir/components/helm/Chart.yaml
+++ b/integrations/agntcy-dir/components/helm/Chart.yaml
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
+# SPDX-License-Identifier: Apache-2.0
+
apiVersion: v2
name: agntcy-dir
description: A Helm chart for Kubernetes
diff --git a/integrations/agntcy-dir/components/helm/values.yaml b/integrations/agntcy-dir/components/helm/values.yaml
index d1870a62..fae0283b 100644
--- a/integrations/agntcy-dir/components/helm/values.yaml
+++ b/integrations/agntcy-dir/components/helm/values.yaml
@@ -1,2 +1,5 @@
+# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
+# SPDX-License-Identifier: Apache-2.0
+
regcred:
create: false
diff --git a/integrations/agntcy-dir/tests/compiler_test.go b/integrations/agntcy-dir/tests/compiler_test.go
index cf7b598b..08935b60 100644
--- a/integrations/agntcy-dir/tests/compiler_test.go
+++ b/integrations/agntcy-dir/tests/compiler_test.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
+// SPDX-License-Identifier: Apache-2.0
+
package tests
import (
diff --git a/integrations/agntcy-dir/tests/push_agent_test.go b/integrations/agntcy-dir/tests/push_agent_test.go
index ca170ae5..bc91d35f 100644
--- a/integrations/agntcy-dir/tests/push_agent_test.go
+++ b/integrations/agntcy-dir/tests/push_agent_test.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
+// SPDX-License-Identifier: Apache-2.0
+
package tests
import (
diff --git a/integrations/agntcy-dir/tests/suite_test.go b/integrations/agntcy-dir/tests/suite_test.go
index 5f2ea8f3..2f024ced 100644
--- a/integrations/agntcy-dir/tests/suite_test.go
+++ b/integrations/agntcy-dir/tests/suite_test.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
+// SPDX-License-Identifier: Apache-2.0
+
package tests
import (
From b913a7d897485e3690e7052d03da37db7116e91d Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 08:16:06 +0100
Subject: [PATCH 08/19] fix: update Taskfile
Signed-off-by: Peter Balogh
---
integrations/Taskfile.yaml | 27 ++++++++++++-------
.../agntcy-dir/tests/compiler_test.go | 2 +-
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index 2794e32a..14dc0941 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -39,27 +39,32 @@ tasks:
cmds:
- kind delete cluster --name {{.KIND_CLUSTER_NAME}}
- kind:load-images:
+ kind:load-images:directory:
desc: Pull and load images to kind
cmds:
# pull images
- - docker pull {{.IMAGE_REPO}}/agp/gw:{{.GATEWAY_IMAGE_TAG}}
- - docker pull {{.IMAGE_REPO}}/dir/dir-apiserver:{{.DIRECTORY_IMAGE_TAG}}
+ - docker pull {{.IMAGE_REPO}}/dir-apiserver:{{.DIRECTORY_IMAGE_TAG}}
+ # load images
+ - kind load docker-image {{.IMAGE_REPO}}/dir-apiserver:{{.DIRECTORY_IMAGE_TAG}} --name {{.KIND_CLUSTER_NAME}}
+ kind:load-images:gateway:
+ desc: Pull and load images to kind
+ cmds:
+ # pull images
+ - docker pull {{.IMAGE_REPO}}/agp/gw:{{.GATEWAY_IMAGE_TAG}}
# load images
- kind load docker-image {{.IMAGE_REPO}}/agp/gw:{{.GATEWAY_IMAGE_TAG}} --name {{.KIND_CLUSTER_NAME}}
- - kind load docker-image {{.IMAGE_REPO}}/dir/dir-apiserver:{{.DIRECTORY_IMAGE_TAG}} --name {{.KIND_CLUSTER_NAME}}
k8s:port-forward:setup:directory:
internal: true
cmds:
- - kubectl port-forward svc/agntcy-dir -n {{ .HELM_NAMESPACE }} 8888 &
+ - kubectl port-forward svc/agntcy-dir-apiserver -n {{ .HELM_NAMESPACE }} 8888 &
- sleep 1
k8s:port-forward:teardown:directory:
internal: true
cmds:
- - kill -9 $(ps aux | grep port-forward | grep agntcy-dir | awk '{print $2}') || true
+ - kill -9 $(ps aux | grep port-forward | grep agntcy-dir-apiserver | awk '{print $2}') || true
k8s:port-forward:setup:gateway:
internal: true
@@ -74,6 +79,8 @@ tasks:
test:env:directory:deploy:
desc: Deploy Agntcy directory test env
+ deps:
+ - kind:load-images:directory
vars:
REGCRED_CREATE: '{{ .REGCRED_CREATE | default "false" }}'
cmds:
@@ -100,7 +107,7 @@ tasks:
test:env:gateway:deploy:
desc: Deploy agntcy gateway test env
deps:
- - kind:load-images
+ - kind:load-images:gateway
cmds:
- |
helm dependency build ./agntcy-agp/components/helm
@@ -128,15 +135,15 @@ tasks:
test:directory:
desc: Directory test
cmds:
- - task: k8s:port-forward:setup
- - defer: { task: k8s:port-forward:teardown }
+ - task: k8s:port-forward:setup:directory
+ - defer: { task: k8s:port-forward:teardown:directory }
- defer: { task: manifests:cleanup }
- IMAGE_REPO={{.IMAGE_REPO}} DIRECTORY_IMAGE_TAG={{.DIRECTORY_IMAGE_TAG}} go test ./agntcy-dir/tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 30m -timeout 30m -ginkgo.v
test:directory:compiler:
desc: Agntcy compiler test
cmds:
- - docker pull {{.IMAGE_REPO}}/dir/dir-ctl:{{.DIRECTORY_IMAGE_TAG}}
+ - docker pull {{.IMAGE_REPO}}/dir-ctl:{{.DIRECTORY_IMAGE_TAG}}
- IMAGE_REPO={{.IMAGE_REPO}} DIRECTORY_IMAGE_TAG={{.DIRECTORY_IMAGE_TAG}} go test ./agntcy-dir/tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 10m -timeout 10m -ginkgo.v -ginkgo.focus "agent compilation"
test:directory:push:
diff --git a/integrations/agntcy-dir/tests/compiler_test.go b/integrations/agntcy-dir/tests/compiler_test.go
index 08935b60..14f5cf17 100644
--- a/integrations/agntcy-dir/tests/compiler_test.go
+++ b/integrations/agntcy-dir/tests/compiler_test.go
@@ -35,7 +35,7 @@ var _ = ginkgo.Describe("Agntcy compiler tests", func() {
mountDest = "/opt/marketing-strategy"
mountString = fmt.Sprintf("%s:%s", marketingStrategyPath, mountDest)
- testdataDir, err := filepath.Abs(filepath.Join(examplesDir, "destdata"))
+ testdataDir, err := filepath.Abs(filepath.Join(examplesDir, "testdata"))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
expectedAgentModelFile = filepath.Join(testdataDir, "expected_agent.json")
From f1abf63112f643efebb96f9a913027edb3379d91 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 09:04:38 +0100
Subject: [PATCH 09/19] fix: remove ipfs config
Signed-off-by: Peter Balogh
---
integrations/Taskfile.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index 14dc0941..caf2b7e8 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -90,7 +90,6 @@ tasks:
./agntcy-dir/components/helm \
--set dir.apiserver.image.tag="{{ .DIRECTORY_IMAGE_TAG }}" \
--set regcred.create="{{ .REGCRED_CREATE }}" \
- --set dir.apiserver.config.ipfs_api_address="http:/agntcy-dir-ipfs.{{ .HELM_NAMESPACE }}.svc.cluster.local:10125" \
--set global.fallbackDefaults.pvcSize="1Gi" \
--namespace {{ .HELM_NAMESPACE }} \
--create-namespace \
From 0cc2bc07d69b12b607ac312308816ae6f79dc7d2 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 09:42:14 +0100
Subject: [PATCH 10/19] fix: update compiler test
Signed-off-by: Peter Balogh
---
.../examples/testdata/expected_agent.json | 45 ++++++++++++++++---
.../agntcy-dir/tests/compiler_test.go | 2 +-
2 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/integrations/agntcy-dir/examples/testdata/expected_agent.json b/integrations/agntcy-dir/examples/testdata/expected_agent.json
index 48a535fa..d984f792 100644
--- a/integrations/agntcy-dir/examples/testdata/expected_agent.json
+++ b/integrations/agntcy-dir/examples/testdata/expected_agent.json
@@ -1,15 +1,24 @@
{
"name": "marketing-strategy",
"version": "v1.0.0",
- "artifact_url": "http://ghcr.io/cisco-agents/marketing-strategy",
- "artifact_type": "docker-image",
+ "locators": [
+ {
+ "type": 2,
+ "source": {
+ "url": "http://ghcr.io/agntcy/marketing-strategy"
+ }
+ }
+ ],
"extensions": [
{
"name": "base",
"version": "v0.0.0",
"specs": {
- "authors": "[author1, author2]",
- "created_at": "2025-01-22T12:08:31Z"
+ "authors": [
+ "author1",
+ "author2"
+ ],
+ "created_at": "2025-02-14T08:39:53Z"
}
},
{
@@ -17,7 +26,31 @@
"version": "v0.0.0",
"specs": {
"language": "python",
- "sbom": "{\"name\":\"marketing-strategy\",\"packages\":[{\"name\":\"crewai\",\"version\":\"0.55.2\"},{\"name\":\"langchain\",\"version\":\"0.2.16\"},{\"name\":\"langchain-ollama\",\"version\":\"0.1.3\"},{\"name\":\"langchain-openai\",\"version\":\"0.1.25\"},{\"name\":\"langgraph\",\"version\":\"0.2.34\"}]}",
+ "sbom": {
+ "name": "marketing-strategy",
+ "packages": [
+ {
+ "name": "crewai",
+ "version": "0.55.2"
+ },
+ {
+ "name": "langchain",
+ "version": "0.2.16"
+ },
+ {
+ "name": "langchain-ollama",
+ "version": "0.1.3"
+ },
+ {
+ "name": "langchain-openai",
+ "version": "0.1.25"
+ },
+ {
+ "name": "langgraph",
+ "version": "0.2.34"
+ }
+ ]
+ },
"version": "\u003e=3.11,\u003c3.13"
}
},
@@ -25,7 +58,7 @@
"name": "category",
"version": "v0.0.0",
"specs": {
- "categories": "[]"
+ "categories": []
}
},
{
diff --git a/integrations/agntcy-dir/tests/compiler_test.go b/integrations/agntcy-dir/tests/compiler_test.go
index 14f5cf17..9ee19ba7 100644
--- a/integrations/agntcy-dir/tests/compiler_test.go
+++ b/integrations/agntcy-dir/tests/compiler_test.go
@@ -48,7 +48,7 @@ var _ = ginkgo.Describe("Agntcy compiler tests", func() {
"build",
"--name=marketing-strategy",
"--version=v1.0.0",
- "--artifact-type=docker-image",
+ "--artifact-type=LOCATOR_TYPE_PYTHON_PACKAGE",
"--artifact-url=http://ghcr.io/agntcy/marketing-strategy",
"--author=author1",
"--author=author2",
From 1b86238e8a22ae8c0b3cdf1b83e3fc40f1fecee1 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 09:49:44 +0100
Subject: [PATCH 11/19] test: check compiler test in GitHub action
Signed-off-by: Peter Balogh
---
.github/workflows/test-integrations.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/test-integrations.yaml b/.github/workflows/test-integrations.yaml
index a70f8821..5811b8ec 100644
--- a/.github/workflows/test-integrations.yaml
+++ b/.github/workflows/test-integrations.yaml
@@ -91,6 +91,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
+ submodules: 'true'
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
@@ -125,5 +126,5 @@ jobs:
- name: Run simple directory tests
run: |
cd integrations
- task test:directory
+ task test:directory:compiler
shell: bash
From accb6f1dc1f272f4016d55ac341638f28f3d096b Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 09:51:40 +0100
Subject: [PATCH 12/19] test: skip dir deploy
Signed-off-by: Peter Balogh
---
.github/workflows/test-integrations.yaml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/test-integrations.yaml b/.github/workflows/test-integrations.yaml
index 5811b8ec..9478d851 100644
--- a/.github/workflows/test-integrations.yaml
+++ b/.github/workflows/test-integrations.yaml
@@ -117,11 +117,11 @@ jobs:
task kind:create
shell: bash
- - name: Deploy agntcy dir
- run: |
- cd integrations
- task test:env:directory:deploy
- shell: bash
+ # - name: Deploy agntcy dir
+ # run: |
+ # cd integrations
+ # task test:env:directory:deploy
+ # shell: bash
- name: Run simple directory tests
run: |
From cd8633de02faf55854c263d9428288d4adad6d74 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 11:01:18 +0100
Subject: [PATCH 13/19] fix: missing zot deploy
Signed-off-by: Peter Balogh
---
.github/workflows/test-integrations.yaml | 14 +++++++-------
integrations/Taskfile.yaml | 5 ++---
integrations/agntcy-dir/components/helm/Chart.yaml | 3 +++
.../agntcy-dir/components/helm/values.yaml | 8 ++++++++
4 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/test-integrations.yaml b/.github/workflows/test-integrations.yaml
index 9478d851..4598af51 100644
--- a/.github/workflows/test-integrations.yaml
+++ b/.github/workflows/test-integrations.yaml
@@ -117,14 +117,14 @@ jobs:
task kind:create
shell: bash
- # - name: Deploy agntcy dir
- # run: |
- # cd integrations
- # task test:env:directory:deploy
- # shell: bash
+ - name: Deploy agntcy dir
+ run: |
+ cd integrations
+ task test:env:directory:deploy
+ shell: bash
- - name: Run simple directory tests
+ - name: Run agent build tests
run: |
cd integrations
- task test:directory:compiler
+ task test:directory
shell: bash
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index caf2b7e8..f2d597ea 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -90,7 +90,6 @@ tasks:
./agntcy-dir/components/helm \
--set dir.apiserver.image.tag="{{ .DIRECTORY_IMAGE_TAG }}" \
--set regcred.create="{{ .REGCRED_CREATE }}" \
- --set global.fallbackDefaults.pvcSize="1Gi" \
--namespace {{ .HELM_NAMESPACE }} \
--create-namespace \
--install \
@@ -148,8 +147,8 @@ tasks:
test:directory:push:
desc: Directory agent push test
cmds:
- - task: k8s:port-forward:setup
- - defer: { task: k8s:port-forward:teardown }
+ - task: k8s:port-forward:setup:directory
+ - defer: { task: k8s:port-forward:teardown:directory }
- defer: { task: manifests:cleanup }
- IMAGE_REPO={{.IMAGE_REPO}} DIRECTORY_IMAGE_TAG={{.DIRECTORY_IMAGE_TAG}} go test ./agntcy-dir/tests -v -failfast -test.v -test.paniconexit0 -ginkgo.timeout 30m -timeout 30m -ginkgo.v -ginkgo.focus "agent push and pull"
diff --git a/integrations/agntcy-dir/components/helm/Chart.yaml b/integrations/agntcy-dir/components/helm/Chart.yaml
index fe74cba0..247a820a 100644
--- a/integrations/agntcy-dir/components/helm/Chart.yaml
+++ b/integrations/agntcy-dir/components/helm/Chart.yaml
@@ -30,3 +30,6 @@ dependencies:
- name: dir
version: "v0.1.0"
repository: oci://ghcr.io/agntcy/dir/helm-charts
+ - name: zot
+ version: "0.1.66"
+ repository: "http://zotregistry.dev/helm-charts"
\ No newline at end of file
diff --git a/integrations/agntcy-dir/components/helm/values.yaml b/integrations/agntcy-dir/components/helm/values.yaml
index fae0283b..ff070c5d 100644
--- a/integrations/agntcy-dir/components/helm/values.yaml
+++ b/integrations/agntcy-dir/components/helm/values.yaml
@@ -3,3 +3,11 @@
regcred:
create: false
+
+dir:
+ apiserver:
+ config:
+ server_port: 8888
+ health_port: 8889
+ provider: "oci"
+ oci_registry_address: "agntcy-dir-zot:5000"
From 483607c116869fd4b29a137933c805d69b148f9f Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 13:42:19 +0100
Subject: [PATCH 14/19] fix: update compiler test
Signed-off-by: Peter Balogh
---
integrations/Taskfile.yaml | 2 +-
.../examples/testdata/expected_agent.json | 20 +++++-------
.../agntcy-dir/tests/compiler_test.go | 31 ++-----------------
.../agntcy-dir/tests/push_agent_test.go | 20 +++++-------
4 files changed, 20 insertions(+), 53 deletions(-)
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index f2d597ea..201a460a 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -12,7 +12,7 @@ vars:
## Image config
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
GATEWAY_IMAGE_TAG: '{{ .GATEWAY_IMAGE_TAG | default "0.1.0-rc0-10-g794c425" }}'
- DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "616b5ce57244db92568ce0b3c85a12f3b36f837c" }}'
+ DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "b0791173edb43fe1bc825bdbd765f414cc3bee68" }}'
IMAGE_BAKE_OPTS: '{{ .IMAGE_BAKE_OPTS | default "--set *.platform=linux/arm64" }}'
TEST_APP_TAG: '{{ .TEST_APP_TAG | default "v0.0.1" }}'
diff --git a/integrations/agntcy-dir/examples/testdata/expected_agent.json b/integrations/agntcy-dir/examples/testdata/expected_agent.json
index d984f792..b6e01b32 100644
--- a/integrations/agntcy-dir/examples/testdata/expected_agent.json
+++ b/integrations/agntcy-dir/examples/testdata/expected_agent.json
@@ -1,26 +1,22 @@
{
"name": "marketing-strategy",
"version": "v1.0.0",
+ "authors": [
+ "author1",
+ "author2"
+ ],
+ "created_at": {
+ "seconds": 1735689600
+ },
"locators": [
{
- "type": 2,
+ "type": 3,
"source": {
"url": "http://ghcr.io/agntcy/marketing-strategy"
}
}
],
"extensions": [
- {
- "name": "base",
- "version": "v0.0.0",
- "specs": {
- "authors": [
- "author1",
- "author2"
- ],
- "created_at": "2025-02-14T08:39:53Z"
- }
- },
{
"name": "runtime",
"version": "v0.0.0",
diff --git a/integrations/agntcy-dir/tests/compiler_test.go b/integrations/agntcy-dir/tests/compiler_test.go
index 9ee19ba7..03665b0b 100644
--- a/integrations/agntcy-dir/tests/compiler_test.go
+++ b/integrations/agntcy-dir/tests/compiler_test.go
@@ -9,7 +9,6 @@ import (
"os"
"path/filepath"
- "github.com/google/go-cmp/cmp"
ginkgo "github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
@@ -48,7 +47,8 @@ var _ = ginkgo.Describe("Agntcy compiler tests", func() {
"build",
"--name=marketing-strategy",
"--version=v1.0.0",
- "--artifact-type=LOCATOR_TYPE_PYTHON_PACKAGE",
+ "--created-at=2025-01-01T00:00:00Z",
+ "--artifact-type=python-package",
"--artifact-url=http://ghcr.io/agntcy/marketing-strategy",
"--author=author1",
"--author=author2",
@@ -80,33 +80,8 @@ var _ = ginkgo.Describe("Agntcy compiler tests", func() {
err = json.Unmarshal([]byte(compiledModelJSON), &compiled)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
- // Filter "created_at" and "security.signature" fields
- filter := cmp.FilterPath(func(p cmp.Path) bool {
- // Ensure the path is deep enough
- if len(p) >= 7 {
- parentStep := p[len(p)-3]
- currentStep := p[len(p)-1]
- if mapStep, ok := p[len(p)-7].(cmp.MapIndex); ok {
- if key, ok := mapStep.Key().Interface().(string); ok && key == "extensions" {
- // Check if the parentStep is a map lookup with key "specs"
- if parentMapIndex, ok := parentStep.(cmp.MapIndex); ok {
- if parentKey, ok := parentMapIndex.Key().Interface().(string); ok && parentKey == "specs" {
- // Check if the currentStep is a map lookup with key "created_at" and "signature"
- if currentMapIndex, ok := currentStep.(cmp.MapIndex); ok {
- if currentKey, ok := currentMapIndex.Key().Interface().(string); ok && (currentKey == "created_at" || currentKey == "signature") {
- return true // Ignore these paths
- }
- }
- }
- }
- }
- }
- }
- return false // Include all other paths
- }, cmp.Ignore())
-
// Check the compiled agent model without extensions field
- gomega.Expect(expected).To(gomega.BeComparableTo(compiled, filter))
+ gomega.Expect(expected).To(gomega.BeComparableTo(compiled))
})
})
})
diff --git a/integrations/agntcy-dir/tests/push_agent_test.go b/integrations/agntcy-dir/tests/push_agent_test.go
index bc91d35f..d3539ebf 100644
--- a/integrations/agntcy-dir/tests/push_agent_test.go
+++ b/integrations/agntcy-dir/tests/push_agent_test.go
@@ -4,7 +4,6 @@
package tests
import (
- "encoding/json"
"fmt"
"os"
"path/filepath"
@@ -22,7 +21,7 @@ var _ = ginkgo.Describe("Agntcy agent push tests", func() {
mountDest string
mountString string
agentModelFile string
- agentID string
+ digest string
)
ginkgo.BeforeEach(func() {
@@ -57,24 +56,21 @@ var _ = ginkgo.Describe("Agntcy agent push tests", func() {
outputBuffer, err := runner.Run(dirctlArgs...)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
- var response map[string]any
+ digest = outputBuffer.String()
- // Unmarshal or Decode the JSON to the interface.
- err = json.Unmarshal(outputBuffer.Bytes(), &response)
- gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
-
- _, err = fmt.Fprintf(ginkgo.GinkgoWriter, "agentID: %v\n", response["id"])
+ _, err = fmt.Fprintf(ginkgo.GinkgoWriter, "digest: %v\n", digest)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
-
- agentID = fmt.Sprintf("%v", response["id"])
})
ginkgo.It("should pull an agent", func() {
+ _, err := fmt.Fprintf(ginkgo.GinkgoWriter, "digest: %v\n", digest)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
dirctlArgs := []string{
"pull",
- "--id",
- agentID,
+ "--digest",
+ digest,
}
if runtime.GOOS != "linux" {
From e3bc4ad1e2a8c46f317d87923700618120811cda Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 13:45:33 +0100
Subject: [PATCH 15/19] chore: print digest on pull
Signed-off-by: Peter Balogh
---
integrations/agntcy-dir/tests/push_agent_test.go | 3 ---
1 file changed, 3 deletions(-)
diff --git a/integrations/agntcy-dir/tests/push_agent_test.go b/integrations/agntcy-dir/tests/push_agent_test.go
index d3539ebf..88d423c8 100644
--- a/integrations/agntcy-dir/tests/push_agent_test.go
+++ b/integrations/agntcy-dir/tests/push_agent_test.go
@@ -57,9 +57,6 @@ var _ = ginkgo.Describe("Agntcy agent push tests", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
digest = outputBuffer.String()
-
- _, err = fmt.Fprintf(ginkgo.GinkgoWriter, "digest: %v\n", digest)
- gomega.Expect(err).NotTo(gomega.HaveOccurred())
})
ginkgo.It("should pull an agent", func() {
From 3e9c84a886efa273436e434a314cdb5498230b21 Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 13:58:17 +0100
Subject: [PATCH 16/19] chore: update chart and images
Signed-off-by: Peter Balogh
---
integrations/Taskfile.yaml | 2 +-
integrations/agntcy-dir/components/helm/Chart.yaml | 5 +----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index 201a460a..1e0fa3e7 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -12,7 +12,7 @@ vars:
## Image config
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
GATEWAY_IMAGE_TAG: '{{ .GATEWAY_IMAGE_TAG | default "0.1.0-rc0-10-g794c425" }}'
- DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "b0791173edb43fe1bc825bdbd765f414cc3bee68" }}'
+ DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "v0.1.1" }}'
IMAGE_BAKE_OPTS: '{{ .IMAGE_BAKE_OPTS | default "--set *.platform=linux/arm64" }}'
TEST_APP_TAG: '{{ .TEST_APP_TAG | default "v0.0.1" }}'
diff --git a/integrations/agntcy-dir/components/helm/Chart.yaml b/integrations/agntcy-dir/components/helm/Chart.yaml
index 247a820a..21e08ae3 100644
--- a/integrations/agntcy-dir/components/helm/Chart.yaml
+++ b/integrations/agntcy-dir/components/helm/Chart.yaml
@@ -28,8 +28,5 @@ appVersion: "0.1.0"
dependencies:
- name: dir
- version: "v0.1.0"
+ version: "v0.1.1"
repository: oci://ghcr.io/agntcy/dir/helm-charts
- - name: zot
- version: "0.1.66"
- repository: "http://zotregistry.dev/helm-charts"
\ No newline at end of file
From 17c3d2edc3f4ecbc4b4b21685aad551acc6d2167 Mon Sep 17 00:00:00 2001
From: Luca Muscariello
Date: Fri, 14 Feb 2025 14:26:03 +0100
Subject: [PATCH 17/19] chore: email address
Signed-off-by: Luca Muscariello
---
SECURITY.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/SECURITY.md b/SECURITY.md
index b80a858a..f83c9ee5 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -2,7 +2,7 @@
The CSIT project team welcomes security reports and is committed to
providing prompt attention to security issues. Security issues should be
-reported privately via [security@agntcy.ai](mailto:security@agntcy.ai).
+reported privately via [security@agntcy.org](mailto:security@agntcy.org).
Security issues should not be reported via the public GitHub Issue tracker.
@@ -16,7 +16,7 @@ users of CSIT, and maintainers of upstream dependencies if applicable.
Downstream project maintainers and CSIT users can request participation in
coordination of applicable security issues by sending your contact email address,
-GitHub username(s) and any other salient information to [security@agntcy.ai](mailto:security@agntcy.ai).
+GitHub username(s) and any other salient information to [security@agntcy.org](mailto:security@agntcy.org).
Participation in security issue coordination processes is at the discretion of the CSIT team.
## Security advisories
From 28becbcb400c0ed0227adc3122f9ce75ff6bfc8b Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 14:34:11 +0100
Subject: [PATCH 18/19] chore: update gw image tag
Signed-off-by: Peter Balogh
---
integrations/Taskfile.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index 1e0fa3e7..82ac829a 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -11,7 +11,7 @@ vars:
## Image config
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
- GATEWAY_IMAGE_TAG: '{{ .GATEWAY_IMAGE_TAG | default "0.1.0-rc0-10-g794c425" }}'
+ GATEWAY_IMAGE_TAG: '{{ .GATEWAY_IMAGE_TAG | default "0.3.0" }}'
DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "v0.1.1" }}'
IMAGE_BAKE_OPTS: '{{ .IMAGE_BAKE_OPTS | default "--set *.platform=linux/arm64" }}'
From 325c05315792456a8e782409f29bbe95a0dd3dba Mon Sep 17 00:00:00 2001
From: Peter Balogh
Date: Fri, 14 Feb 2025 17:17:07 +0100
Subject: [PATCH 19/19] fix: minor issues
Signed-off-by: Peter Balogh
---
integrations/Taskfile.yaml | 2 +-
integrations/agntcy-dir/components/helm/Chart.yaml | 2 +-
integrations/agntcy-dir/tests/push_agent_test.go | 8 ++++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/integrations/Taskfile.yaml b/integrations/Taskfile.yaml
index 82ac829a..86f24a4d 100644
--- a/integrations/Taskfile.yaml
+++ b/integrations/Taskfile.yaml
@@ -12,7 +12,7 @@ vars:
## Image config
IMAGE_REPO: '{{ .IMAGE_REPO | default "ghcr.io/agntcy" }}'
GATEWAY_IMAGE_TAG: '{{ .GATEWAY_IMAGE_TAG | default "0.3.0" }}'
- DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "v0.1.1" }}'
+ DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG | default "v0.1.2" }}'
IMAGE_BAKE_OPTS: '{{ .IMAGE_BAKE_OPTS | default "--set *.platform=linux/arm64" }}'
TEST_APP_TAG: '{{ .TEST_APP_TAG | default "v0.0.1" }}'
diff --git a/integrations/agntcy-dir/components/helm/Chart.yaml b/integrations/agntcy-dir/components/helm/Chart.yaml
index 21e08ae3..461d02c5 100644
--- a/integrations/agntcy-dir/components/helm/Chart.yaml
+++ b/integrations/agntcy-dir/components/helm/Chart.yaml
@@ -28,5 +28,5 @@ appVersion: "0.1.0"
dependencies:
- name: dir
- version: "v0.1.1"
+ version: "v0.1.2"
repository: oci://ghcr.io/agntcy/dir/helm-charts
diff --git a/integrations/agntcy-dir/tests/push_agent_test.go b/integrations/agntcy-dir/tests/push_agent_test.go
index 88d423c8..0818e52d 100644
--- a/integrations/agntcy-dir/tests/push_agent_test.go
+++ b/integrations/agntcy-dir/tests/push_agent_test.go
@@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"runtime"
+ "strings"
ginkgo "github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
@@ -56,12 +57,12 @@ var _ = ginkgo.Describe("Agntcy agent push tests", func() {
outputBuffer, err := runner.Run(dirctlArgs...)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())
- digest = outputBuffer.String()
+ digest = strings.Trim(outputBuffer.String(), "\n")
})
ginkgo.It("should pull an agent", func() {
- _, err := fmt.Fprintf(ginkgo.GinkgoWriter, "digest: %v\n", digest)
+ _, err := fmt.Fprintf(ginkgo.GinkgoWriter, "digest: %s\n", digest)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
dirctlArgs := []string{
@@ -77,6 +78,9 @@ var _ = ginkgo.Describe("Agntcy agent push tests", func() {
)
}
+ _, err = fmt.Fprintf(ginkgo.GinkgoWriter, "dirctl args: %v\n", dirctlArgs)
+ gomega.Expect(err).NotTo(gomega.HaveOccurred())
+
runner := testutils.NewDockerRunner(dockerImage, mountString, nil)
outputBuffer, err := runner.Run(dirctlArgs...)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), outputBuffer.String())