Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: datachain release banner and updates #5284

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/data/datachain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Datasets are getting larger, but the ability to iterate rapidly and
efficiently is as important as ever.
terminal: |
from dvcx.query import C, DatasetQuery
from dvcx.lib.webdataset import WebDataset
from dvcx.lib.gpt4_vision import DescribeImage
from datachain.query import C, DatasetQuery
from datachain.lib.webdataset import WebDataset
from datachain.lib.gpt4_vision import DescribeImage

prompt = "How many people in the image?"

Expand All @@ -21,6 +21,6 @@
Save the results of a query in a dataset that you can use to train your ML
models.
terminal: |
$ dvcx query my-query.py my-dataset
$ datachain query my-query.py my-dataset
..........
Dataset 'my-dataset' created
19 changes: 11 additions & 8 deletions src/components/Home/Alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import Link from '@dvcorg/gatsby-theme-iterative/src/components/Link'
import { cn } from '../../../utils'
import { githubDatachainUrl } from '../../../utils/externalUrls'
import { ReactComponent as GithubSVG } from '@dvcorg/gatsby-theme-iterative/src/components/SocialIcon/github.svg'

const banner = {
title:
'DataChain Open-Source Release - A New Way to Manage your Unstructured Data',
subtitle: 'Webinar | Wednesday, July 24th | 11 am ET',
link: 'https://www.linkedin.com/events/7217199578704445442/about/'
title: 'DataChain Open-Source Release',
subtitle: 'A New Way to Manage your Unstructured Data',
link: githubDatachainUrl
}

const Alert = () => (
<>
<div className={cn('py-2', 'bg-orange text-white', `w-full`)}>
<div className="flex items-center gap-3 justify-center">
<div className="text-right">
<strong>{banner.title}</strong>
<div>{banner.subtitle}</div>
<strong className="font-medium text-xl">{banner.title}</strong>
<div className="text-sm">{banner.subtitle}</div>
</div>
<div>
<Link
Expand All @@ -26,10 +27,12 @@ const Alert = () => (
'font-medium',
'whitespace-nowrap',
'bg-orange-50 text-orange-700',
'hover:bg-white'
'hover:bg-white',
'flex items-center'
)}
>
Register Now
Star us on GitHub{' '}
<GithubSVG className="h-5 w-5 inline-block text-orange" />
</Link>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/Hero/BetterTogether/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const BetterTogether = () => {
return (
<HeroContainer className="py-14 bg-blue-100">
<h2 className={cn('text-center text-3xl font-medium')}>
DVCx and DVC: Better Together
Datachain and DVC: Better Together
</h2>
<p className={cn('mt-8', 'text-xl font-normal')}>
Build the datasets you need without modifying your data sources. Create
Expand Down
23 changes: 21 additions & 2 deletions src/components/Home/Hero/GetStarted/GetStartedWithDatachain.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import HeroContainer from '../../../HeroContainer'
import { cn } from '../../../../utils'
import DatachainSlides from '../../LandingHero/DatachainSlides'
import GetOnTheWaitlistForm from '../GetOnTheWaitlist/Form'
import { ReactComponent as GithubSVG } from '@dvcorg/gatsby-theme-iterative/src/components/SocialIcon/github.svg'

import { CTAButton } from '../HeroSection'
import { githubDatachainUrl } from '../../../../utils/externalUrls'
import { navigateLink } from '../../../../utils/urls'

const GetStartedWithDatachain = () => {
return (
Expand All @@ -12,7 +16,22 @@ const GetStartedWithDatachain = () => {
</div>
<DatachainSlides />
<div className={cn('flex flex-col items-center justify-center w-full')}>
<GetOnTheWaitlistForm />
<CTAButton
className={cn(
'bg-purple hover:bg-[var(--color-purple-hover)] text-light',
'text-center',
'min-w-max',
'justify-center',
'min-h-[3rem]',
'disabled:bg-gray-400 disabled:cursor-not-allowed'
)}
type="button"
onClick={() => {
navigateLink(githubDatachainUrl)
}}
>
Star us on Github <GithubSVG className="h-6 w-6 inline-block" />
</CTAButton>
</div>
</HeroContainer>
)
Expand Down
29 changes: 22 additions & 7 deletions src/components/Home/Hero/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useStars from '../../../gatsby/hooks/stars'
import Link from '@dvcorg/gatsby-theme-iterative/src/components/Link'
import { navigate } from 'gatsby'
import { StaticImage } from 'gatsby-plugin-image'
import { githubDatachainUrl, githubDvcUrl } from '../../../utils/externalUrls'

interface ISectionProps {
className?: string
Expand Down Expand Up @@ -90,6 +91,7 @@ export const CTAButton = ({

const HeroSection = () => {
const stars = useStars()
const datachainStars = useStars('datachain')

return (
<div className="md:border-y-2 md:border-solid md:border-y-light">
Expand All @@ -104,9 +106,25 @@ const HeroSection = () => {
)}
>
<h2 className="text-2xl md:text-3xl font-medium">
GenAI dataset management
GenAI data chain
</h2>
<Badge className="bg-dark text-light">Coming soon</Badge>
<Link
href={githubDatachainUrl}
className="no-underline hover:opacity-80"
>
<Badge className="bg-dark text-light">
{datachainStars ? (
shortenNumber(datachainStars, 1)
) : (
<span className="animate-pulse">---</span>
)}
<img
src="/img/landing/github.svg"
alt="Github Logo"
className="h-5 w-5"
/>
</Badge>
</Link>
</div>
</Section>
<Section>
Expand All @@ -117,10 +135,7 @@ const HeroSection = () => {
<h2 className="text-2xl md:text-3xl font-medium">
Data and model versioning
</h2>
<Link
href="https://github.com/iterative/dvc"
className="no-underline hover:opacity-80"
>
<Link href={githubDvcUrl} className="no-underline hover:opacity-80">
<Badge className={cn('bg-dark text-light')}>
{stars ? (
shortenNumber(stars, 1)
Expand Down Expand Up @@ -175,7 +190,7 @@ const HeroSection = () => {
})
}}
>
<span>Learn about DVCx</span>
<span>Learn about Datachain</span>
<ArrowDown className="w-4 md:w-6 animate-bounce" />
</CTAButton>
</Section>
Expand Down
11 changes: 6 additions & 5 deletions src/gatsby/hooks/stars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useStaticQuery, graphql } from 'gatsby'
import fetch from 'isomorphic-fetch'
import * as Sentry from '@sentry/gatsby'

export default function useStars(): number | null {
export default function useStars(repo = 'dvc'): number | null {
// Get the amount of stars from build time
const staticStars = useStaticQuery(graphql`
query GithubStarsQuery {
Expand All @@ -13,14 +13,15 @@ export default function useStars(): number | null {
}
`).staticGithubData.stars

const defaultStars = repo === 'dvc' ? staticStars : null
// Maintain an updatable state so we can update stars on delivery
const [stars, setStars] = useState(staticStars)
const [stars, setStars] = useState(defaultStars)

// Run an IIFE to update from the server on the client side.
useEffect(() => {
;(async (): Promise<void> => {
try {
const res = await fetch(`/api/github/stars?repo=dvc`)
const res = await fetch(`/api/github/stars?repo=${repo}`)

if (res.status === 200) {
const json = await res.json()
Expand All @@ -29,11 +30,11 @@ export default function useStars(): number | null {
Sentry.captureMessage(
`Stars update response status was ${res.status}! Using static value.`
)
setStars(staticStars)
setStars(defaultStars)
}
} catch (error) {
Sentry.captureException(error)
setStars(staticStars)
setStars(defaultStars)
}
})()
}, [])
Expand Down
4 changes: 4 additions & 0 deletions src/utils/externalUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export const studioUrl = 'https://studio.iterative.ai'
// export const cloudUrl = 'https://cloud.dvc.ai'
export const cloudUrl = studioUrl

// Github Urls
export const githubDatachainUrl = `https://github.com/iterative/datachain`
export const githubDvcUrl = `https://github.com/iterative/dvc`

// HubSpot Forms
interface IHubSpotFormUrlOptions {
portalId?: string
Expand Down
13 changes: 13 additions & 0 deletions src/utils/urls.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { navigate } from 'gatsby'

export function isExternalLink(url: string) {
return /^https?:\/\//.test(url)
}

export const navigateLink = (link: string) => {
if (isExternalLink(link)) {
return window.open(link, `_blank`, `noreferrer`)
} else {
navigate(link)
}
}
Loading