From 46012ef959c6b56a81f1662c01da8dbc8249b93f Mon Sep 17 00:00:00 2001 From: George Herbert Date: Sat, 9 Mar 2024 23:10:00 +0000 Subject: [PATCH] chore: move docker build to github container registry --- ...cr.yml => build-and-push-docker-image.yml} | 60 +++++++++------- .../ui/src/components/traces/traces-page.tsx | 3 +- packages/ui/src/components/ui/breadcrumb.tsx | 68 +++++++++---------- 3 files changed, 69 insertions(+), 62 deletions(-) rename .github/workflows/{build-and-push-to-acr.yml => build-and-push-docker-image.yml} (68%) diff --git a/.github/workflows/build-and-push-to-acr.yml b/.github/workflows/build-and-push-docker-image.yml similarity index 68% rename from .github/workflows/build-and-push-to-acr.yml rename to .github/workflows/build-and-push-docker-image.yml index bc497d0..39d6b76 100644 --- a/.github/workflows/build-and-push-to-acr.yml +++ b/.github/workflows/build-and-push-docker-image.yml @@ -12,26 +12,29 @@ on: required: false jobs: - push_ingest_to_acr: + push_ingest_to_ghcr: if: ${{ !cancelled() && inputs.langtrace-ingest-image-tag != null }} - name: Build and push Langtrace ingest component to Azure ACR + name: Build and push Langtrace ingest component to Github Container Registry runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - name: Log into Azure Container Registry - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: - registry: ${{ secrets.DOCKER_AZURE_CONTAINER_REGISTRY_PATH }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Get metadata for Docker build id: meta uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5 with: - images: ${{ secrets.DOCKER_AZURE_CONTAINER_REGISTRY_PATH }}/langtrace-ingest + images: ghcr.io/${{ github.repository_owner }}/langtrace-ingest tags: | type=schedule type=ref,event=branch @@ -39,7 +42,6 @@ jobs: type=ref,event=pr type=semver,pattern={{version}},value=${{ inputs.langtrace-ingest-image-tag }} - - name: Build and push Docker image uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5 with: @@ -48,26 +50,29 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - push_ui_to_acr: + push_ui_to_ghcr: if: ${{ !cancelled() && inputs.langtrace-ui-image-tag != null }} - name: Build and push Langtrace UI component to Azure ACR + name: Build and push Langtrace UI component to Github Container Registry runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - name: Log into Azure Container Registry - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: - registry: ${{ secrets.DOCKER_AZURE_CONTAINER_REGISTRY_PATH }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Get metadata for Docker build id: meta uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5 with: - images: ${{ secrets.DOCKER_AZURE_CONTAINER_REGISTRY_PATH }}/langtrace-ui + images: ghcr.io/${{ github.repository_owner }}/langtrace-ui tags: | type=schedule type=ref,event=branch @@ -85,28 +90,31 @@ jobs: # This is here to placate the build process and can be overridden at runtime. build-args: | - langtrace_api_url=http://localhost:1984 + langtrace_api_url=http://localhost:1994 - push_api_to_acr: + push_api_to_ghcr: if: ${{ !cancelled() && inputs.langtrace-api-image-tag != null }} - name: Build and push Langtrace API component to Azure ACR + name: Build and push Langtrace API component to Github Container Registry runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - name: Log into Azure Container Registry - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: - registry: ${{ secrets.DOCKER_AZURE_CONTAINER_REGISTRY_PATH }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Get metadata for Docker build id: meta uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5 with: - images: ${{ secrets.DOCKER_AZURE_CONTAINER_REGISTRY_PATH }}/langtrace-api + images: ghcr.io/${{ github.repository_owner }}/langtrace-api tags: | type=schedule type=ref,event=branch diff --git a/packages/ui/src/components/traces/traces-page.tsx b/packages/ui/src/components/traces/traces-page.tsx index 7533d60..8f3bbe7 100644 --- a/packages/ui/src/components/traces/traces-page.tsx +++ b/packages/ui/src/components/traces/traces-page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable'; import TracesTable from '@/components/traces/traces-table'; import { FeedbackCount, TracePercentile } from '@/models/responses/traces-response'; @@ -10,7 +10,6 @@ import { FeedbackFilters, TracesFilterContext } from '@/components/traces/contexts/traces-filter-context'; -import { useBreadcrumbs } from '@/contexts/breadcrump-context'; interface TracesPageProps { projectId: string; diff --git a/packages/ui/src/components/ui/breadcrumb.tsx b/packages/ui/src/components/ui/breadcrumb.tsx index 6708f3d..597ae8b 100644 --- a/packages/ui/src/components/ui/breadcrumb.tsx +++ b/packages/ui/src/components/ui/breadcrumb.tsx @@ -1,108 +1,108 @@ -import * as React from "react" -import { ChevronRightIcon, DotsHorizontalIcon } from "@radix-ui/react-icons" -import { Slot } from "@radix-ui/react-slot" +import * as React from 'react'; +import { ChevronRightIcon, DotsHorizontalIcon } from '@radix-ui/react-icons'; +import { Slot } from '@radix-ui/react-slot'; -import { cn } from "@/lib/utils" +import { cn } from '@/lib/utils'; const Breadcrumb = React.forwardRef< HTMLElement, - React.ComponentPropsWithoutRef<"nav"> & { + React.ComponentPropsWithoutRef<'nav'> & { separator?: React.ReactNode } ->(({ ...props }, ref) =>