Skip to content

Commit

Permalink
Merge branch 'superset'
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Dec 4, 2024
2 parents 26899da + 794fb95 commit 6a866cc
Show file tree
Hide file tree
Showing 18 changed files with 729 additions and 127 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ vars/*.tfvars
prod-user-pool.json
*-secret-vars.yml
/configure/certificates/**
/configure/dummy.yml
/configure/dummy.yml
/reportingSystem/superset/superset.env
186 changes: 151 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
},
"license": "AGPL-3.0",
"scripts": {},
"dependencies": {},
"dependencies": {
"node-fetch": "^3.3.2"
},
"type": "module",
"devDependencies": {
"amazon-cognito-identity-js": "1.28.0"
}
Expand Down
1 change: 1 addition & 0 deletions reportingSystem/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
28 changes: 28 additions & 0 deletions reportingSystem/superset/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG TAG=latest

FROM --platform=linux/amd64 apache/superset:${TAG}


#Copy avni logo and favicon
ADD --chown=superset https://raw.githubusercontent.com/avniproject/avni-website/master/src/img/avni-logo-color.png /app/superset/static/assets/images/avni.png
ADD --chown=superset https://github.com/avniproject/avni-webapp/raw/master/public/favicon.ico /app/superset/static/assets/images/avni-favicon.ico

# Copy the configuration file, set the environment variable,
COPY --chown=superset ./assets/superset_config.py /app/

#Environment variable
ENV SUPERSET_SECRET_KEY=dummy
ENV SUPERSET_DB_NAME=dummy
ENV SUPERSET_DB_USER=dummy
ENV SUPERSET_DB_PASSWORD=dummy
ENV SUPERSET_DB_URL=dummy
ENV SUPERSET_DB_PORT=dummy
ENV SUPERSET_CONFIG_PATH=/app/superset_config.py


# Expose the port
EXPOSE 8088


# Run superset
ENTRYPOINT ["superset", "run", "-h", "0.0.0.0", "-p", "8088", "--with-threads", "--reload", "--debugger"]
59 changes: 59 additions & 0 deletions reportingSystem/superset/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
IMAGE := avniproject/reporting-superset
TAG ?= 4.0.1

build-image:
@echo "building image $(IMAGE):$(TAG)"
docker image build --build-arg TAG=$(TAG) -t $(IMAGE):$(TAG) .

re-build-image:delete-image
@echo "building image $(IMAGE):$(TAG)"
docker image build --build-arg version=$(TAG) -t $(IMAGE):$(TAG) .

delete-image:
@if docker image inspect $(IMAGE):$(TAG) > /dev/null 2>&1; then \
echo "Image $(IMAGE):$(TAG) found. Deleting..."; \
docker image rm -f $(IMAGE):$(TAG); \
else \
echo "Image $(IMAGE):$(TAG) not found."; \
fi

push-image:
@if [ -z "$(REPO_URI)" ]; then \
echo "REPO_URI is not set"; \
exit 1; \
fi
@if docker image inspect $(REPO_URI)/$(IMAGE):$(TAG) > /dev/null 2>&1; then \
echo "Image $(REPO_URI)/$(IMAGE):$(TAG) found. deleting from the local"; \
docker image rm -f $(IMAGE):$(TAG); \
else \
echo "Image $(REPO_URI)/$(IMAGE):$(TAG) not found in local."; \
fi
docker tag $(IMAGE):$(TAG) $(REPO_URI)/$(IMAGE):$(TAG)
echo "pushing image $(REPO_URI)/$(IMAGE):$(TAG)";
docker push $(REPO_URI)/$(IMAGE):$(TAG)

delete-repo-image:
@if [ -z "$(REPO_URI)" ]; then \
echo "REPO_URI is not set"; \
exit 1; \
fi
docker image rm $(REPO_URI)/$(IMAGE):$(TAG)

inspect-image:
docker image inspect $(IMAGE):$(TAG)

run-container:
docker run -d -p 8088:8088 \
--name superset_$(TAG) \
--env-file superset.env \
$(IMAGE):$(TAG)
@$(MAKE) get-container-logs

remove-container:
docker container rm -f superset_$(TAG)

get-container-logs:
docker logs -f superset_$(TAG)

execute-container:
docker container exec -it superset_$(TAG) bash
Loading

0 comments on commit 6a866cc

Please sign in to comment.