Skip to content

Commit

Permalink
chore: move nodejs instrumentation agent source code to separate repo (
Browse files Browse the repository at this point in the history
  • Loading branch information
blumamir authored Jul 17, 2024
1 parent 823fed3 commit 7e79b36
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 5,487 deletions.
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,6 @@ updates:
otel-dependencies:
patterns:
- "go.opentelemetry.io*"
- package-ecosystem: npm
directory: /agents/nodejs
schedule:
day: sunday
interval: weekly
groups:
otel-dependencies:
patterns:
- "@opentelemetry*"
- package-ecosystem: pip
directory: /odiglet/agents/python
schedule:
Expand Down
30 changes: 22 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,45 @@ Test your cli code changes by running the following:
go run -tags=embed_manifests ./cli
```

To run `odigos install` cli command from a local source, you will need to supply a version flag to tell odigos which image tags to install:
To run `odigos install` cli command from a local source, use the make command from repo root:

```bash
go run -tags=embed_manifests ./cli install --version v0.1.81
make cli-install
# Installing Odigos version v0.1.81 in namespace odigos-system ...
```

If you test changes to the `install` command, you will need to `go run cli/main.go uninstall` first before you can run install again.
If you test changes to the `install` command, you will need to `odigos uninstall` first before you can run install again.

### How to Develop Odigos Locally

The main steps involved when debugging Odigos locally are:

1. Use a Kind kubernetes cluster.
2. Choose one of the following options for deploy:

- Deploy all pods in the odigos-system namespace:

```bash
make deploy
make deploy
```

- Deploy a specific service by running one of the following commands:

```bash
make deploy-odiglet
make deploy-autoscaler
make deploy-collector
make deploy-instrumentor
```

- Deploy odiglet and build instrumentation agents from source code:

First - make sure you clone the [nodejs agent](https://github.com/odigos-io/opentelemetry-node) repos in the same directory as the odigos repo. e.g. `../opentelemetry-node` should exist alongside the odigos repo in your local filesystem.

To deploy odiglet with agents from this source directory:

```bash
make deploy-odiglet
make deploy-autoscaler
make deploy-collector
make deploy-instrumentor
make deploy-odiglet-with-agents
```

See the [Odigos docs](https://docs.odigos.io/intro) for the full steps on debugging Odigos locally.
Expand Down
27 changes: 26 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
TAG ?= $(shell odigos version --cluster)
ODIGOS_CLI_VERSION ?= $(shell odigos version --cli)
ORG := keyval

.PHONY: build-odiglet
build-odiglet:
docker build -t $(ORG)/odigos-odiglet:$(TAG) . -f odiglet/Dockerfile --build-arg ODIGOS_VERSION=$(TAG)

.PHONY: verify-nodejs-agent
verify-nodejs-agent:
@if [ ! -f ../opentelemetry-node/package.json ]; then \
echo "Error: To build odiglet agents from source, first clone the agents code locally"; \
exit 1; \
fi

.PHONY: build-odiglet-with-agents
build-odiglet-with-agents:
docker build -t $(ORG)/odigos-odiglet:$(TAG) . -f odiglet/Dockerfile --build-arg ODIGOS_VERSION=$(TAG) --build-context nodejs-agent-native-community-src=../opentelemetry-node

.PHONY: build-autoscaler
build-autoscaler:
docker build -t $(ORG)/odigos-autoscaler:$(TAG) . --build-arg SERVICE_NAME=autoscaler
Expand Down Expand Up @@ -117,6 +129,12 @@ restart-collector:
deploy-odiglet:
make build-odiglet TAG=$(TAG) && make load-to-kind-odiglet TAG=$(TAG) && make restart-odiglet

# Use this target to deploy odiglet with local clones of the agents.
# To work, the agents must be cloned in the same directory as the odigos (e.g. in '../opentelemetry-node')
# There you can make code changes to the agents and deploy them with the odiglet.
.PHONY: deploy-odiglet-with-agents
deploy-odiglet-with-agents: verify-nodejs-agent build-odiglet-with-agents load-to-kind-odiglet restart-odiglet

.PHONY: deploy-autoscaler
deploy-autoscaler:
make build-autoscaler TAG=$(TAG) && make load-to-kind-autoscaler TAG=$(TAG) && make restart-autoscaler
Expand Down Expand Up @@ -163,4 +181,11 @@ check-clean-work-tree:
git --no-pager diff; \
echo 'Working tree is not clean, did you forget to run "make go-mod-tidy"?'; \
exit 1; \
fi
fi

# installs odigos from the local source, with local changes to api and cli directorie reflected in the odigos deployment
.PHONY: cli-install
cli-install:
@echo "Installing odigos from source. version: $(ODIGOS_CLI_VERSION)"
go run -tags=embed_manifests ./cli install --version $(ODIGOS_CLI_VERSION)

1 change: 0 additions & 1 deletion agents/nodejs/.dockerignore

This file was deleted.

201 changes: 0 additions & 201 deletions agents/nodejs/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions agents/nodejs/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions agents/nodejs/package.json

This file was deleted.

Loading

0 comments on commit 7e79b36

Please sign in to comment.