Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
daoleno committed Jan 16, 2024
1 parent 1bc94b6 commit e45adc5
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: DockerBuild

on:
push:
branches: [main]
tags:
- "v*"
# branches: [main]
# tags:
# - "v*"
# pull_request:
# branches: [main]

Expand Down
2 changes: 1 addition & 1 deletion dashboard/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DUCKDB_PATH=lens-public-data/sample
DUCKDB_PATH=lens-public-data/v2_polygon.db
1 change: 0 additions & 1 deletion dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ COPY . .
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED 1
ENV PARQUET_DIR_PATH lens-public-data/sample

RUN yarn build

Expand Down
6 changes: 6 additions & 0 deletions dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ bun install
bun dev
```

## Build Docker Image

```bash
docker build --build-arg DUCKDB_PATH=/path/to/v2_polygon.db -t lenscan .
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Expand Down
2 changes: 1 addition & 1 deletion dashboard/components/dau-stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Card, CardContent, CardHeader } from "@/components/ui/card"
import {
getDauGrowthPercentages,
getNetworkUserStats,
} from "@/app/api/analystics/active-users/getDailyActiveUser"
} from "@/app/api/analystics/active-users/getActiveUserStats"

export default async function DauStats() {
const dateRange = "1M"
Expand Down
9 changes: 5 additions & 4 deletions dashboard/lib/duckdb.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Database } from "duckdb-async"

const accessMode = 0 // 1 = read/write, 0 = read-only
const duckdb = await Database.create(process.env.DUCKDB_PATH, {
access_mode: "READ_ONLY",
})
const readonly = 1 // 1 = readonly, 0 = readwrite
const duckdb = await Database.create(
process.env.DUCKDB_PATH as string,
readonly
)

export { duckdb }
30 changes: 30 additions & 0 deletions dashboard/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Set environment variables
REGISTRY="ghcr.io"
IMAGE_NAME="daoleno/lenscan"
DUCKDB_PATH=lens-public-data/v2_polygon.db

# Ask for the tag
echo "Please enter the tag for the Docker image:"
read TAG

# Log in to the container registry
echo "Logging in to the container registry..."
echo "Please enter your GitHub Personal Access Token:"
read -s GITHUB_TOKEN # Read the GitHub Token securely
echo $GITHUB_TOKEN | docker login $REGISTRY -u daoleno --password-stdin

# Build the Docker image, add --build-arg if needed
echo "Building the Docker image..."
docker build -t $REGISTRY/$IMAGE_NAME:$TAG ./dashboard # Ensure the correct build context is used

# Push the Docker image to the registry
echo "Pushing the Docker image..."
docker push $REGISTRY/$IMAGE_NAME:$TAG

# Log out from the container registry
echo "Logging out from the container registry..."
docker logout $REGISTRY

echo "Docker image build and push completed."

0 comments on commit e45adc5

Please sign in to comment.