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

Copy graphite storage config from nav container or other source #21

Open
oyvindkolbu opened this issue Jan 31, 2023 · 1 comment
Open
Assignees

Comments

@oyvindkolbu
Copy link
Contributor

Currently during the build of the carbon cache container it will copy graphite storage config from an three year old
container in a private registory:

COPY --from=mbrekkevold/nav:latest /etc/nav/graphite/storage-schemas.conf ${GRAPHITE_CONF_DIR}/storage-schemas.conf
COPY --from=mbrekkevold/nav:latest /etc/nav/graphite/storage-aggregation.conf ${GRAPHITE_CONF_DIR}/storage-aggregation.conf

The files could be copied from the nav container being built as part of the docker compose, though just doing a straight
docker-compose build will not work as will build carbon-cache before nav, due to depends_on. Explicitly building
nav first with docker-compose build nav and then docker-compose build will work, though not elegant.

diff --git a/carbon-cache/Dockerfile b/carbon-cache/Dockerfile
index 982d860..a5a7cbc 100644
--- a/carbon-cache/Dockerfile
+++ b/carbon-cache/Dockerfile
@@ -11,8 +11,8 @@ ENV GRAPHITE_CONF_DIR /etc/carbon
 RUN apt-get update && apt-get install -y graphite-carbon

 COPY carbon.conf ${GRAPHITE_CONF_DIR}/carbon.conf
-COPY --from=mbrekkevold/nav:latest /etc/nav/graphite/storage-schemas.conf ${GRAPHITE_CONF_DIR}/storage-schemas.conf
-COPY --from=mbrekkevold/nav:latest /etc/nav/graphite/storage-aggregation.conf ${GRAPHITE_CONF_DIR}/storage-aggregation.conf
+COPY --from=localhost/nav-container_nav:latest /etc/nav/graphite/storage-schemas.conf ${GRAPHITE_CONF_DIR}/storage-schemas.conf
+COPY --from=localhost/nav-container_nav:latest /etc/nav/graphite/storage-aggregation.conf ${GRAPHITE_CONF_DIR}/storage-aggregation.conf
@lunkwill42
Copy link
Member

lunkwill42 commented Mar 20, 2023

Currently during the build of the carbon cache container it will copy graphite storage config from an three year old container in a private registory:

COPY --from=mbrekkevold/nav:latest /etc/nav/graphite/storage-schemas.conf ${GRAPHITE_CONF_DIR}/storage-schemas.conf
COPY --from=mbrekkevold/nav:latest /etc/nav/graphite/storage-aggregation.conf ${GRAPHITE_CONF_DIR}/storage-aggregation.conf

Actually, I think this was written this way due to the build process defined by Makefile. If the images are built using this file, they will be tagged locally as mbrekkevold/nav:latest. The Makefile was written to build and push the nav-container images to the dockerhub under these names (which I have, regrettably, not done in three years).

Anyway, I don't much care for this way of getting the files. I'm also not convinced your suggested edits will quite do the trick, because they depend on the naming scheme of the current project. If you cloned nav-container to a differently named directory, or Docker Compose once again decides to change how it builds its container names (e.g. it recently replaced underscores with dashes, or vice versa), this will stop working.

Perhaps a more reliable method would be to give the NAV version as a build argument also to the docker image, so that it can pull the example config files from the correct NAV version, maybe directly off of GitHub.

@lunkwill42 lunkwill42 self-assigned this May 23, 2023
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

No branches or pull requests

2 participants