Skip to content

Commit

Permalink
Use registry.odigos.io for images and update default image-prefix (
Browse files Browse the repository at this point in the history
…#2438)

This updates the code to use `registry.odigos.io/*` instead of
dockerhub/`keyval/`. This also changes the default for the
`image-prefix` setting to `registry.odigos.io`

The reasoning for this is that previously, all of our images were on
dockerhub under the keyval org. For example: `keyval/odigos-odiglet`

This really evaluates to `docker.io/keyval/odigos-odiglet`, meaning that
even though the default value for `--image-prefix` is technically empty,
it is actually essentially defaulting to `--image-prefix=docker.io`.
This is why the new default `--image-prefix` is changing.

In addition, with the new registry, all of our images are hosted
directly under the main domain, such as
`registry.odigos.io/odigos-odiglet`

So, there is no need for us to add the `keyval/` prefix to our images
anymore. Similarly, there is no reason for users to add `keyval/` to
their own images when using their own registry. This is why we are
dropping it from the default image names.

These changes may be initially breaking to some users, but I think it is
a lot more intuitive:

* Default prefix: `docker.io`->`registry.odigos.io`
* Default image names `keyval/odigos-<component>` ->
`odigos-<component>`
  • Loading branch information
damemi authored Feb 17, 2025
1 parent 1eff4ad commit d927f68
Show file tree
Hide file tree
Showing 29 changed files with 274 additions and 105 deletions.
165 changes: 165 additions & 0 deletions .github/workflows/release-artifactregistry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: Release Odigos

on:
workflow_dispatch:
inputs:
tag:
description: "Tag"
required: true

repository_dispatch:
types: [release_cli]

permissions:
contents: write
packages: write
id-token: 'write'

env:
DOCKERHUB_ORG: "keyval"

jobs:
release-cli:
runs-on: ubuntu-latest
steps:
- name: Determine Tag Value
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" = "repository_dispatch" ]; then
echo "TAG=${{ github.event.client_payload.tag }}" >> $GITHUB_ENV
else
echo "Unknown event type"
exit 1
fi
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.TAG }}

- name: Set env
id: vars
run: |
SHORT_COMMIT=$(git rev-parse --short HEAD)
echo "short_commit=${SHORT_COMMIT}" >> $GITHUB_ENV
echo "date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
- name: Notify Slack Start
env:
SLACK_WEBHOOK_URL: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"description":"Starting Odigos CLI release", "tag":"${{ env.TAG }}"}' ${{ env.SLACK_WEBHOOK_URL }}
- name: Verify Components Image Ready
run: |
declare -a REPOS=("odigos-autoscaler" "odigos-scheduler" "odigos-instrumentor" "odigos-odiglet" "odigos-collector" "odigos-enterprise-odiglet" "odigos-ui")
TAG_TO_CHECK=${{ env.TAG }}
for REPO in "${REPOS[@]}"; do
echo "Checking tag $TAG_TO_CHECK in $REPO..."
TAGS_JSON=$(curl -s "https://artifactregistry.us-central1.rep.googleapis.com/v1/projects/odigos-cloud/locations/us-central1/repositories/components/packages/$REPO/tags")
if echo "$TAGS_JSON" | grep -q "\"name\": \"projects/odigos-cloud/locations/us-central1/repositories/components/packages/$REPO/tags/$TAG_TO_CHECK"; then
echo "Tag $TAG_TO_CHECK exists in Docker Hub repository $REPO."
else
echo "Tag $TAG_TO_CHECK does not exist in Docker Hub repository $REPO."
exit 1
fi
done
- id: gcp-auth
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
access_token_lifetime: 1200s

- name: Login to Artifact Registry
uses: docker/login-action@v3
with:
registry: us-central1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcp-auth.outputs.access_token }}

- uses: actions/setup-go@v5
with:
go-version: "1.23"

- uses: actions/setup-node@v4
with:
node-version: 18

- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}

- uses: ko-build/[email protected]

- name: publish cli image to docker registries
working-directory: ./cli
env:
KO_DOCKER_REPO: us-central1-docker.pkg.dev/odigos-cloud/components/odigos-cli
KO_CONFIG_PATH: ./.ko.yaml
VERSION: ${{ env.TAG }}
SHORT_COMMIT: ${{ steps.vars.outputs.short_commit }}
DATE: ${{ steps.vars.outputs.date }}
run: |
ko build --bare --tags latest --tags ${{ env.TAG }} --platform=all .
- name: Notify Slack End
env:
SLACK_WEBHOOK_URL: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"description":"Odigos CLI released successfully. new version is ready", "tag":"${{ env.TAG }}"}' ${{ env.SLACK_WEBHOOK_URL }}
- name: Notify Slack on Failure
if: ${{ failure() || cancelled() }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"link":"https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}", "description":"ERROR: failed to publish odigos CLI", "tag":"${{ env.TAG }}"}' ${{ env.SLACK_WEBHOOK_URL }}
release-helm:
needs: [release-cli]
runs-on: ubuntu-latest
steps:
- name: Determine Tag Value
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" = "repository_dispatch" ]; then
echo "TAG=${{ github.event.client_payload.tag }}" >> $GITHUB_ENV
else
echo "Unknown event type"
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Odigos Release Bot"
- name: Install Helm
uses: azure/[email protected]
with:
version: v3.15.2

- name: Release Helm charts
env:
GH_TOKEN: ${{ github.token }}
run: bash ./scripts/release-charts.sh
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TAG ?= $(shell odigos version --cluster)
ODIGOS_CLI_VERSION ?= $(shell odigos version --cli)
ORG ?= keyval
ORG ?= registry.odigos.io
GOLANGCI_LINT_VERSION ?= v1.63.4
GOLANGCI_LINT := $(shell go env GOPATH)/bin/golangci-lint
GO_MODULES := $(shell find . -type f -name "go.mod" -not -path "*/vendor/*" -exec dirname {} \; | grep -v "licenses")
Expand Down
1 change: 1 addition & 0 deletions api/k8sconsts/autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package k8sconsts
const (
AutoScalerDeploymentName = "odigos-autoscaler"
AutoScalerImageUBI9 = "odigos-autoscaler-ubi9"
AutoScalerImageName = "odigos-autoscaler"
AutoScalerServiceAccountName = AutoScalerDeploymentName
AutoScalerAppLabelValue = AutoScalerDeploymentName
AutoScalerRoleName = AutoScalerDeploymentName
Expand Down
2 changes: 1 addition & 1 deletion api/k8sconsts/clustercollector.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package k8sconsts

const (
OdigosClusterCollectorImage = "keyval/odigos-collector"
OdigosClusterCollectorImage = "odigos-collector"
OdigosClusterCollectorImageUBI9 = "odigos-collector-ubi9"

OdigosClusterCollectorDeploymentName = "odigos-gateway"
Expand Down
1 change: 1 addition & 0 deletions api/k8sconsts/instrumentor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const (
InstrumentorOtelServiceName = "instrumentor"
InstrumentorDeploymentName = "odigos-instrumentor"
InstrumentorImageUBI9 = "odigos-instrumentor-ubi9"
InstrumentorImageName = "odigos-instrumentor"
InstrumentorAppLabelValue = InstrumentorDeploymentName
InstrumentorServiceName = InstrumentorDeploymentName
InstrumentorServiceAccountName = InstrumentorDeploymentName
Expand Down
2 changes: 1 addition & 1 deletion api/k8sconsts/keyvalproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package k8sconsts
const (
OdigosCloudProxyVersion = "v0.11.0"
KeyvalProxyServiceName = "odigos-cloud-k8s"
KeyvalProxyImage = "keyval/odigos-proxy-k8s"
KeyvalProxyImage = "odigos-proxy-k8s"
KeyvalProxyAppName = "odigos-cloud-proxy"
KeyvalProxyDeploymentName = "odigos-cloud-proxy"
KeyvalProxyServiceAccountName = "odigos-cloud-proxy"
Expand Down
4 changes: 2 additions & 2 deletions api/k8sconsts/odiglet.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const (
OdigletClusterRoleName = OdigletDaemonSetName
OdigletClusterRoleBindingName = OdigletDaemonSetName
OdigletContainerName = "odiglet"
OdigletImageName = "keyval/odigos-odiglet"
OdigletEnterpriseImageName = "keyval/odigos-enterprise-odiglet"
OdigletImageName = "odigos-odiglet"
OdigletEnterpriseImageName = "odigos-enterprise-odiglet"
OdigletEnterpriseImageUBI9 = "odigos-enterprise-odiglet-ubi9"
OdigletImageUBI9 = "odigos-odiglet-ubi9"
// Used to indicate that the odiglet is installed on a node.
Expand Down
2 changes: 1 addition & 1 deletion api/k8sconsts/scheduler.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package k8sconsts

const (
SchedulerImage = "keyval/odigos-scheduler"
SchedulerImage = "odigos-scheduler"
SchedulerImageUBI9 = "odigos-scheduler-ubi9"
SchedulerServiceName = "scheduler"
SchedulerDeploymentName = "odigos-scheduler"
Expand Down
2 changes: 1 addition & 1 deletion api/k8sconsts/ui.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package k8sconsts

const (
UIImage = "keyval/odigos-ui"
UIImage = "odigos-ui"
UIImageUBI9 = "odigos-ui-ubi9"
UIServiceName = "ui"
UIDeploymentName = "odigos-ui"
Expand Down
2 changes: 1 addition & 1 deletion autoscaler/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import (
var (
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
defaultCollectorImage = "keyval/odigos-collector"
defaultCollectorImage = "registry.odigos.io/odigos-collector"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ func init() {
installCmd.Flags().BoolVar(&openshiftEnabled, "openshift", false, "configure requirements for OpenShift: required selinux settings, RBAC roles, and will use OpenShift certified images (if --image-prefix is not set)")
installCmd.Flags().BoolVar(&skipWebhookIssuerCreation, "skip-webhook-issuer-creation", false, "Skip creating the Issuer and Certificate for the Instrumentor pod webhook if cert-manager is installed.")
installCmd.Flags().StringVar(&odigletImage, "odiglet-image", "", "odiglet container image name")
installCmd.Flags().StringVar(&instrumentorImage, "instrumentor-image", "keyval/odigos-instrumentor", "instrumentor container image name")
installCmd.Flags().StringVar(&autoScalerImage, "autoscaler-image", "keyval/odigos-autoscaler", "autoscaler container image name")
installCmd.Flags().StringVar(&imagePrefix, "image-prefix", "", "prefix for all container images. used when your cluster doesn't have access to docker hub")
installCmd.Flags().StringVar(&instrumentorImage, "instrumentor-image", k8sconsts.InstrumentorImageName, "instrumentor container image name")
installCmd.Flags().StringVar(&autoScalerImage, "autoscaler-image", k8sconsts.AutoScalerImageName, "autoscaler container image name")
installCmd.Flags().StringVar(&imagePrefix, "image-prefix", "registry.odigos.io", "prefix for all container images.")
installCmd.Flags().BoolVar(&psp, "psp", false, "enable pod security policy")
installCmd.Flags().StringSliceVar(&userInputIgnoredNamespaces, "ignore-namespace", k8sconsts.DefaultIgnoredNamespaces, "namespaces not to show in odigos ui")
installCmd.Flags().StringSliceVar(&userInputIgnoredContainers, "ignore-container", k8sconsts.DefaultIgnoredContainers, "container names to exclude from instrumentation (useful for sidecar container)")
Expand Down
6 changes: 3 additions & 3 deletions docs/cli/odigos_install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ odigos install --onprem-token ${ODIGOS_TOKEN} --profile ${YOUR_ENTERPRISE_PROFIL

```
-k, --api-key string api key for odigos cloud
--autoscaler-image string autoscaler container image name (default "keyval/odigos-autoscaler")
--autoscaler-image string autoscaler container image name (default "odigos-autoscaler")
--central-backend-url string URL for centralized Odigos backend
-h, --help help for install
--ignore-container strings container names to exclude from instrumentation (useful for sidecar container) (default [istio-proxy,vault-agent,filebeat,linkerd-proxy,fluentd,akeyless-init])
--ignore-namespace strings namespaces not to show in odigos ui (default [kube-system,local-path-storage,istio-system,linkerd,kube-node-lease])
--image-prefix string prefix for all container images. used when your cluster doesn't have access to docker hub
--instrumentor-image string instrumentor container image name (default "keyval/odigos-instrumentor")
--image-prefix string prefix for all container images. (default "registry.odigos.io")
--instrumentor-image string instrumentor container image name (default "odigos-instrumentor")
-n, --namespace string target k8s namespace for Odigos installation (default "odigos-system")
--nowait skip waiting for odigos pods to be ready
--odiglet-image string odiglet container image name
Expand Down
40 changes: 21 additions & 19 deletions docs/setup/docker-registry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,40 @@ export CUSTOM_DOCKER_REGISTRY=<YOUR-CUSTOM-DOCKER-REGISTRY>
Replace `<YOUR-DESIRED-VERSION>` with the version of the Odigos images you want to use, and `<YOUR-CUSTOM-DOCKER-REGISTRY>` with the URL of your custom Docker registry.

### Step 2: Pull the Images
Start by pulling the required images from the official Docker Hub onto your local machine or CI environment:
Start by pulling the required images from the official Odigos registry onto your local machine or CI environment:

```bash
docker pull keyval/odigos-scheduler:$VERSION
docker pull keyval/odigos-instrumentor:$VERSION
docker pull keyval/odigos-ui:$VERSION
docker pull keyval/odigos-autoscaler:$VERSION
docker pull keyval/odigos-odiglet:$VERSION
docker pull keyval/odigos-collector:$VERSION
docker pull registry.odigos.io/odigos-scheduler:$VERSION
docker pull registry.odigos.io/odigos-instrumentor:$VERSION
docker pull registry.odigos.io/odigos-ui:$VERSION
docker pull registry.odigos.io/odigos-autoscaler:$VERSION
docker pull registry.odigos.io/odigos-odiglet:$VERSION
docker pull registry.odigos.io/odigos-collector:$VERSION
```

### Step 3: Tag the Images
Next, Tag each image with your custom Docker registry prefix:

```bash
docker tag keyval/odigos-scheduler:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-scheduler:$VERSION
docker tag keyval/odigos-instrumentor:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-instrumentor:$VERSION
docker tag keyval/odigos-ui:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-ui:$VERSION
docker tag keyval/odigos-autoscaler:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-autoscaler:$VERSION
docker tag keyval/odigos-odiglet:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-odiglet:$VERSION
docker tag keyval/odigos-collector:$VERSION $CUSTOM_DOCKER_REGISTRY/keyval/odigos-collector:$VERSION
docker tag registry.odigos.io/odigos-scheduler:$VERSION $CUSTOM_DOCKER_REGISTRY/odigos-scheduler:$VERSION
docker tag registry.odigos.io/odigos-instrumentor:$VERSION $CUSTOM_DOCKER_REGISTRY/odigos-instrumentor:$VERSION
docker tag registry.odigos.io/odigos-ui:$VERSION $CUSTOM_DOCKER_REGISTRY/odigos-ui:$VERSION
docker tag registry.odigos.io/odigos-autoscaler:$VERSION $CUSTOM_DOCKER_REGISTRY/odigos-autoscaler:$VERSION
docker tag registry.odigos.io/odigos-odiglet:$VERSION $CUSTOM_DOCKER_REGISTRY/odigos-odiglet:$VERSION
docker tag registry.odigos.io/odigos-collector:$VERSION $CUSTOM_DOCKER_REGISTRY/odigos-collector:$VERSION
```

> **Note:** Prior to v1.0.155, Odigos images were prefixed with `keyval/` (such as `keyval/odigos-scheduler`) In v1.0.155+, this is no longer the case, and Odigos does not assume this prefix. If you were hosting custom images prior to this version, you may have to re-tag your images to remove the `keyval/` prefix.
### Step 4: Push the Images
Now, push the tagged images to your custom Docker registry:
```bash
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-scheduler:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-instrumentor:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-ui:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-autoscaler:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-odiglet:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/keyval/odigos-collector:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/odigos-scheduler:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/odigos-instrumentor:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/odigos-ui:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/odigos-autoscaler:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/odigos-odiglet:$VERSION
docker push $CUSTOM_DOCKER_REGISTRY/odigos-collector:$VERSION
```

### Step 5: Configure Access for Private Registries
Expand Down
4 changes: 2 additions & 2 deletions helm/odigos/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- define "utils.imageName" -}}
{{- $defaultRegistry := "docker.io/keyval" -}}
{{- $defaultRegistry := "registry.odigos.io" -}}
{{- $redHatRegistry := "registry.connect.redhat.com/odigos" -}}
{{- if $.Values.imagePrefix -}}
{{- $.Values.imagePrefix -}}/keyval/
{{- $.Values.imagePrefix -}}/
{{- else -}}
{{- if $.Values.openshift.enabled -}}
{{- $redHatRegistry -}}/
Expand Down
Loading

0 comments on commit d927f68

Please sign in to comment.