From ef6223ebe1ae0d23a2fe28a0647b4b06c224ba61 Mon Sep 17 00:00:00 2001 From: Taylor North Date: Mon, 11 Mar 2024 09:24:18 +0000 Subject: [PATCH 1/4] fix: changes from coral have been moved over also includes webpack command --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5cfde2f..4a629f6 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,14 @@ TOOLKIT_REPO = https://github.com/flaxandteal/arches-container-toolkit TOOLKIT_FOLDER = docker TOOLKIT_RELEASE = main ARCHES_PROJECT ?= $(shell ls -1 */__init__.py | head -n 1 | sed 's/\/.*//g') -ARCHES_BASE = ghcr.io/flaxandteal/arches-base-7.5-dev:feature-django-casbin--testing +ARCHES_BASE = ghcr.io/flaxandteal/arches-base-7.5-dev:coral ARCHES_PROJECT_ROOT = $(shell pwd)/ DOCKER_COMPOSE_COMMAND = ARCHES_PROJECT_ROOT=$(ARCHES_PROJECT_ROOT) ARCHES_BASE=$(ARCHES_BASE) ARCHES_PROJECT=$(ARCHES_PROJECT) docker-compose -p $(ARCHES_PROJECT) -f docker/docker-compose.yml CMD ?= create: docker echo $(shell id -u) - FORUSER=$(shell id -u) $(DOCKER_COMPOSE_COMMAND) run -e FORUSER=$(shell id -u) --entrypoint /bin/sh arches_base -c ". ../ENV/bin/activate; apt update; apt install -y git; pip install 'pyjwt<2.1,>=2.0.0' 'cryptography<3.4.0' --only-binary cryptography --only-binary cffi; cd /local_root; ls -ltr; id -u; arches-project create $(ARCHES_PROJECT) && mv docker Makefile $(ARCHES_PROJECT); ls -ltr; echo \$${FORUSER}; groupadd -g \$${FORUSER} externaluser; useradd -u \$${FORUSER} -g \$${FORUSER} externaluser; chown -R \$${FORUSER}:\$${FORUSER} $(ARCHES_PROJECT); echo \$$?; ls -ltr $(ARCHES_PROJECT)" + FORUSER=$(shell id -u) $(DOCKER_COMPOSE_COMMAND) run -e FORUSER=$(shell id -u) --entrypoint /bin/sh arches_base -c ". ../ENV/bin/activate; apt install -y git; pip install 'pyjwt<2.1,>=2.0.0' 'cryptography<3.4.0' --only-binary cryptography --only-binary cffi; cd /local_root; ls -ltr; id -u; arches-project create $(ARCHES_PROJECT) && mv docker Makefile $(ARCHES_PROJECT); ls -ltr; echo \$${FORUSER}; groupadd -g \$${FORUSER} externaluser; useradd -u \$${FORUSER} -g \$${FORUSER} externaluser; chown -R \$${FORUSER}:\$${FORUSER} $(ARCHES_PROJECT); echo \$$?; ls -ltr $(ARCHES_PROJECT)" cypress.config.js: dl-docker cp docker/tests/cypress.config.js $(ARCHES_PROJECT_ROOT) @@ -70,7 +70,7 @@ build: docker $(DOCKER_COMPOSE_COMMAND) run --entrypoint /web_root/entrypoint.sh arches_worker install_yarn_components $(DOCKER_COMPOSE_COMMAND) run --entrypoint /web_root/entrypoint.sh arches_worker bootstrap - if [ -d $(ARCHES_PROJECT)/pkg ]; then NO_LOAD_BUSINESS_DATA="$(NO_LOAD_BUSINESS_DATA)" $(TOOLKIT_FOLDER)/act.py . load_package --yes; fi + if [ -d $(ARCHES_PROJECT)/pkg ]; then $(TOOLKIT_FOLDER)/act.py . load_package --yes; fi $(DOCKER_COMPOSE_COMMAND) run --entrypoint /web_root/entrypoint.sh arches_worker run_yarn_build_development $(DOCKER_COMPOSE_COMMAND) stop @echo "IF THIS IS YOUR FIRST TIME RUNNING make build AND YOU HAVE NOT ALREADY, MAKE SURE TO UPDATE urls.py (see make help)" @@ -108,6 +108,10 @@ docker-compose: docker manage: docker $(DOCKER_COMPOSE_COMMAND) run --entrypoint /bin/bash arches_worker -c '. ../ENV/bin/activate; python manage.py $(CMD)' +.PHONY: webpack +webpack: docker + $(DOCKER_COMPOSE_COMMAND) run --entrypoint /bin/bash arches_worker -c '. ../ENV/bin/activate; cd $(ARCHES_PROJECT); DJANGO_MODE=DEV NODE_PATH=./media/node_modules NODE_OPTIONS=--max_old_space_size=8192 node --inspect ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js' + .PHONY: clean clean: docker @echo -n "This will remove all database and elasticsearch data, are you sure? [y/N] " && read confirmation && [ $${confirmation:-N} = y ] From cee2ff2a4e64fbd637b5e9b5d446f449638af7d6 Mon Sep 17 00:00:00 2001 From: Taylor North Date: Thu, 28 Mar 2024 15:09:24 +0000 Subject: [PATCH 2/4] fix: give permissions to uploadedfiles directory --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 982bbc7..1bd477e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,8 @@ RUN . ../ENV/bin/activate \ && pip install cachetools websockets pika \ && (if [ -f ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt ]; then pip install -r ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt --no-binary :all:; fi) +RUN chgrp -R arches ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles && chmod -R g+rw ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles + COPY docker/settings_docker.py ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/settings_local.py RUN echo "{}" > ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/webpack/webpack-stats.json From 9387943ab3486660f9d191f3ee4616ed86745405 Mon Sep 17 00:00:00 2001 From: Taylor North Date: Thu, 28 Mar 2024 15:44:25 +0000 Subject: [PATCH 3/4] fix: create uploadedfiles directory if it does not exist --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1bd477e..868320f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN . ../ENV/bin/activate \ && pip install cachetools websockets pika \ && (if [ -f ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt ]; then pip install -r ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt --no-binary :all:; fi) -RUN chgrp -R arches ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles && chmod -R g+rw ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles +RUN mkdir -p ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles && chgrp -R arches ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles && chmod -R g+rw ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles COPY docker/settings_docker.py ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/settings_local.py RUN echo "{}" > ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/webpack/webpack-stats.json From d1e35bb1909c58c41a39cd56449ca7ce1ab5ff10 Mon Sep 17 00:00:00 2001 From: Taylor North Date: Tue, 2 Apr 2024 17:08:53 +0100 Subject: [PATCH 4/4] fix: gcc compiler and python header files are no longer present in build --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 868320f..befdf2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ ARG ARCHES_PROJECT ENV ARCHES_PROJECT $ARCHES_PROJECT COPY docker/entrypoint.sh ${WEB_ROOT}/ RUN apt-get update && apt-get -y install python3-libxml2 git +RUN apt-get -y install build-essential python3-dev RUN . ../ENV/bin/activate \ && pip install --upgrade pip setuptools \ && pip install starlette-graphene3 \