Skip to content

add local dev config for website#160

Open
nikbpetrov wants to merge 2 commits intoforecastingresearch:mainfrom
nikbpetrov:add-localdev-config-for-website
Open

add local dev config for website#160
nikbpetrov wants to merge 2 commits intoforecastingresearch:mainfrom
nikbpetrov:add-localdev-config-for-website

Conversation

@nikbpetrov
Copy link
Contributor

will probably need better documentation and some additional dev/staging tooling (e.g. pull latest data from GCS instead of reusing old data from assets/)

-v "$$(pwd):/srv/jekyll" \
-w /srv/jekyll --entrypoint "" \
$(LOCAL_DOCKER_IMAGE_TAG) \
bundle exec jekyll serve --host 0.0.0.0 --config _config.yml,_config_dev.yml --livereload No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove _config_dev.yml, that's just there for the dev project site that's publicly visible so no one who accidentally sees it confuses it with the official site.

LOCAL_DOCKER_IMAGE_TAG = forecastbench-website

dev-build : Dockerfile
@test -f entrypoint.sh || echo '#!/bin/sh' > entrypoint.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the deployment since it leaves entrypoint.sh in the directory. If you then run make website from the root directory without first running make clean, it will find this entrypoint.sh instead of generating it from the entrypoint.sh rule.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch; not needed anyway with --entrypoint during docker run

@houtanb
Copy link
Member

houtanb commented Feb 23, 2026

Also, re this, I want to serve local files, so do not want to pull data from GCS.

@nikbpetrov
Copy link
Contributor Author

Also, re this, I want to serve local files, so do not want to pull data from GCS.

That's what happens, though, right? Scripts and whatnot reference the local /assets folder that has some outdated files in there. In a non-local setup, those files will be replaced by the GC pipeline that mounts volumes etc.

Tbh, I'd want the opposite dev utility, where I can fetch locally all the most recent data from staging, but that's a problem for another day.

@houtanb
Copy link
Member

houtanb commented Feb 23, 2026

Yes, that's what happens. I'm responding to the comment above:

will probably need better documentation and some additional dev/staging tooling (e.g. pull latest data from GCS instead of reusing old data from assets/)

Given this folder is for website development, the values of the leaderboard rarely matter. It's true that if we want to view the latest data generated locally on the website when we serve it locally, it needs to be copied over by hand but, thus far, this has not been frequently needed as an html leaderboard is also saved to the datasets repo.

LOCAL_DOCKER_IMAGE_TAG = forecastbench-website

dev-build : Dockerfile
@test -f entrypoint.sh || echo '#!/bin/sh' > entrypoint.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now getting

• make dev-serve
docker build -t forecastbench-website .
[+] Building 0.2s (10/11)                                                                            docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                 0.0s
 => => transferring dockerfile: 893B                                                                                 0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2                                                          0.2s
 => [internal] load .dockerignore                                                                                    0.0s
 => => transferring context: 2B                                                                                      0.0s
 => [1/7] FROM docker.io/library/ruby:3.2@sha256:3efdfe957fde240e2a13782cab92f2d0cc2f1001438c339be669054b1db3fe7e    0.0s
 => [internal] load build context                                                                                    0.0s
 => => transferring context: 20.52kB                                                                                 0.0s
 => CACHED [2/7] WORKDIR /srv/jekyll                                                                                 0.0s
 => CACHED [3/7] COPY Gemfile Gemfile.lock ./                                                                        0.0s
 => CACHED [4/7] RUN apt-get update &&     apt-get install -y ruby-full build-essential zlib1g-dev &&     gem insta  0.0s
 => CACHED [5/7] COPY . .                                                                                            0.0s
 => ERROR [6/7] COPY entrypoint.sh /entrypoint.sh                                                                    0.0s
------
 > [6/7] COPY entrypoint.sh /entrypoint.sh:
------
Dockerfile:20
--------------------
  18 |     COPY . .
  19 |
  20 | >>> COPY entrypoint.sh /entrypoint.sh
  21 |     RUN chmod +x /entrypoint.sh
  22 |     ENTRYPOINT ["/entrypoint.sh"]
--------------------
ERROR: failed to build: failed to solve: failed to compute cache key: failed to calculate checksum of ref d2a2e76f-80f1-405f-93f2-395730db7034::kcm9219vomkbuq2d1k2ef847l: "/entrypoint.sh": not found

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/ieu86hiuqniwe766mhprcjcws
make: *** [dev-build] Error 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will get back to this during the refactor. Local dev tools have no business in the makefile logic anyways - this makefile should be job-specific issuance only, and not co-located with the rest of the website logic.

Was meant as a quick trick to allow local dev if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants