add local dev config for website#160
add local dev config for website#160nikbpetrov wants to merge 2 commits intoforecastingresearch:mainfrom
Conversation
src/www.forecastbench.org/Makefile
Outdated
| -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 |
There was a problem hiding this comment.
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.
src/www.forecastbench.org/Makefile
Outdated
| LOCAL_DOCKER_IMAGE_TAG = forecastbench-website | ||
|
|
||
| dev-build : Dockerfile | ||
| @test -f entrypoint.sh || echo '#!/bin/sh' > entrypoint.sh |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
nice catch; not needed anyway with --entrypoint during docker run
|
Also, re this, I want to serve local files, so do not want to pull data from GCS. |
… and use _config.yml only)
That's what happens, though, right? Scripts and whatnot reference the local 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. |
|
Yes, that's what happens. I'm responding to the comment above:
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. |
src/www.forecastbench.org/Makefile
Outdated
| LOCAL_DOCKER_IMAGE_TAG = forecastbench-website | ||
|
|
||
| dev-build : Dockerfile | ||
| @test -f entrypoint.sh || echo '#!/bin/sh' > entrypoint.sh |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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/)