Skip to content

Commit

Permalink
chore: move docker build to github container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeherby committed Mar 9, 2024
1 parent 46db05b commit 46012ef
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,36 @@ 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
type=ref,event=tag
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:
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/traces/traces-page.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -10,7 +10,6 @@ import {
FeedbackFilters,
TracesFilterContext
} from '@/components/traces/contexts/traces-filter-context';
import { useBreadcrumbs } from '@/contexts/breadcrump-context';

interface TracesPageProps {
projectId: string;
Expand Down
68 changes: 34 additions & 34 deletions packages/ui/src/components/ui/breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -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) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
Breadcrumb.displayName = "Breadcrumb"
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
Breadcrumb.displayName = 'Breadcrumb';

const BreadcrumbList = React.forwardRef<
HTMLOListElement,
React.ComponentPropsWithoutRef<"ol">
React.ComponentPropsWithoutRef<'ol'>
>(({ className, ...props }, ref) => (
<ol
ref={ref}
className={cn(
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
className
)}
{...props}
/>
))
BreadcrumbList.displayName = "BreadcrumbList"
));
BreadcrumbList.displayName = 'BreadcrumbList';

const BreadcrumbItem = React.forwardRef<
HTMLLIElement,
React.ComponentPropsWithoutRef<"li">
React.ComponentPropsWithoutRef<'li'>
>(({ className, ...props }, ref) => (
<li
ref={ref}
className={cn("inline-flex items-center gap-1.5", className)}
className={cn('inline-flex items-center gap-1.5', className)}
{...props}
/>
))
BreadcrumbItem.displayName = "BreadcrumbItem"
));
BreadcrumbItem.displayName = 'BreadcrumbItem';

const BreadcrumbLink = React.forwardRef<
HTMLAnchorElement,
React.ComponentPropsWithoutRef<"a"> & {
React.ComponentPropsWithoutRef<'a'> & {
asChild?: boolean
}
>(({ asChild, className, ...props }, ref) => {
const Comp = asChild ? Slot : "a"
const Comp = asChild ? Slot : 'a';

return (
<Comp
ref={ref}
className={cn("transition-colors hover:text-foreground", className)}
className={cn('transition-colors hover:text-foreground', className)}
{...props}
/>
)
})
BreadcrumbLink.displayName = "BreadcrumbLink"
);
});
BreadcrumbLink.displayName = 'BreadcrumbLink';

const BreadcrumbPage = React.forwardRef<
HTMLSpanElement,
React.ComponentPropsWithoutRef<"span">
React.ComponentPropsWithoutRef<'span'>
>(({ className, ...props }, ref) => (
<span
ref={ref}
role="link"
aria-disabled="true"
aria-current="page"
className={cn("font-normal text-foreground", className)}
className={cn('font-normal text-foreground', className)}
{...props}
/>
))
BreadcrumbPage.displayName = "BreadcrumbPage"
));
BreadcrumbPage.displayName = 'BreadcrumbPage';

const BreadcrumbSeparator = ({
children,
className,
...props
}: React.ComponentProps<"li">) => (
}: React.ComponentProps<'li'>) => (
<li
role="presentation"
aria-hidden="true"
className={cn("[&>svg]:size-3.5", className)}
className={cn('[&>svg]:size-3.5', className)}
{...props}
>
{children || <ChevronRightIcon />}
</li>
)
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
);
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';

const BreadcrumbEllipsis = ({
className,
...props
}: React.ComponentProps<"span">) => (
}: React.ComponentProps<'span'>) => (
<span
role="presentation"
aria-hidden="true"
className={cn("flex h-9 w-9 items-center justify-center", className)}
className={cn('flex h-9 w-9 items-center justify-center', className)}
{...props}
>
<DotsHorizontalIcon className="h-4 w-4" />
<span className="sr-only">More</span>
</span>
)
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
);
BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis';

export {
Breadcrumb,
Expand All @@ -112,4 +112,4 @@ export {
BreadcrumbPage,
BreadcrumbSeparator,
BreadcrumbEllipsis,
}
};

0 comments on commit 46012ef

Please sign in to comment.