Skip to content
Snippets Groups Projects
Commit 16bbe85c authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: .gitignore

	modified:   Dockerfile
	new file:   Singularity
	new file:   mysql_sever/Dockerfile
	new file:   mysql_sever/Makefile
	new file:   mysql_sever/Singularity
	new file:   mysql_sever/config.env
	new file:   mysql_sever/version.sh
parent 378e3e54
Branches master
No related tags found
No related merge requests found
*.tar
*.simg
*.img
......@@ -135,8 +135,6 @@ RUN cd /opt \
&& mkdir -p sane08 \
&& cd sane08 \
&& git clone --depth=1 https://eicweb.phy.anl.gov/whit/insane.git insane \
&& git clone --depth=1 https://eicweb.phy.anl.gov/whit/Analyzer_new \
&& git clone --depth=1 https://eicweb.phy.anl.gov/whit/sane_replay \
&& git clone --depth=1 https://eicweb.phy.anl.gov/whit/BETAG4
RUN cd /tmp \
......@@ -161,25 +159,31 @@ RUN cd /tmp \
SHELL ["/bin/bash", "-c"]
RUN useradd -ms /bin/bash -d /opt/saneuser saneuser
RUN useradd -ms /bin/bash -d /opt/saneuser saneuser \
&& apt-get install -y cernlib-*
ADD saneuser_home_dir.tar /root/.
ADD saneuser_home_dir.tar /opt/saneuser/.
#RUN mkdir -p /opt/saneuser/bin \
# && cd /opt/saneuser/bin/ \
# && wget https://hallcweb.jlab.org/experiments/sane/whit/sane08_farm_scripts.tar.gz -O - | tar -xzv \
# && chown -R saneuser:saneuser /opt/saneuser \
# && chown -R saneuser:saneuser /opt/sane08 \
# && cd /opt/sane08 \
# && ln -s /opt/sane08/insane InSANE \
# && cd /opt/saneuser \
# && ln -s /opt/sane08 \
# && ls -lrth
#
#RUN apt-get install -y cernlib-*
#RUN cd /opt/sane08/Analyzer_new && make
#
#USER saneuser
#WORKDIR /opt/saneuser
RUN mkdir -p /opt/sane08 \
&& cd /opt/sane08 \
&& ls -lrth \
&& git clone --depth=1 https://eicweb.phy.anl.gov/whit/Analyzer_new \
&& git clone --depth=1 https://eicweb.phy.anl.gov/whit/sane_replay \
&& cd /opt/sane08/Analyzer_new && make
RUN mkdir -p /opt/saneuser/bin \
&& cd /opt/saneuser/bin/ \
&& wget https://hallcweb.jlab.org/experiments/sane/whit/sane08_farm_scripts.tar.gz -O - | tar -xzv \
&& chown -R saneuser:saneuser /opt/saneuser \
&& chown -R saneuser:saneuser /opt/sane08 \
&& cd /opt/sane08 \
&& ln -s /opt/sane08/insane InSANE \
&& cd /opt/saneuser \
&& ln -s /opt/sane08 \
&& ls -lrth
USER saneuser
WORKDIR /opt/saneuser
Bootstrap: docker
From: whit2333/insane:latest
%runscript
echo "This is what happens when you run the container..."
%post
echo "Hello from inside the container"
echo "Install additional software here"
%help
Help me. I'm in the container.
%labels
Maintainer "Whitney Armstrong"
Version v0.1
# sane08 mysql database
#
# A container for the SANE experiment
#
FROM mariadb:latest
LABEL maintainer "Whitney Armstrong <warmstrong@anl.gov>"
EXPOSE 5900 3306
ENV MYSQL_ROOT_PASSWORD sane2008
COPY sane08_database.sql /opt/.
#RUN mysql -u -psane2008 < /root/sane08_database.sql
#COPY my.cnf /etc/mysql/conf.d/jlab.cnf
#RUN mysqladmin -u root password sane2008 \
# && mysqladmin -u root -h password sane2008
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
APP_NAME=sane_db
DOCKER_REPO=whit2333
TAG_NAME=$(DOCKER_REPO)/$(APP_NAME)
TAG_VERSION=latest
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
#dpl ?= deploy.env
#include $(dpl)
#export $(shell sed 's/=.*//' $(dpl))
# grep the version from the mix file
VERSION=$(shell ./version.sh)
# HELP
# This will output the help for each task
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
# DOCKER TASKS
#
# Build the container
build: ## build container
docker build -t $(TAG_NAME):$(TAG_VERSION) .
build-nc: ## Build the container without caching
docker build --no-cache -t $(TAG_NAME):$(TAG_VERSION) .
connect: ## Run container on port configured in `config.env`
docker exec -it sane_db bash
#docker run -i -t --rm --env-file=./config.env -p=$(PORT):$(PORT) --name="$(APP_NAME)_bash" $(TAG_NAME):$(TAG_VERSION) bash
run: ## Run container on port configured in `config.env`
docker run -i -t --rm --env-file=./config.env -p=$(PORT):$(PORT) --name="$(APP_NAME)_bash" $(TAG_NAME):$(TAG_VERSION) bash
launch: ## launch the container (run detatched)
docker run --env-file=./config.env -p=$(PORT):$(PORT) --name="$(APP_NAME)" -d $(TAG_NAME):$(TAG_VERSION)
home:
cd home_dir && tar -cvf saneuser_home_dir.tar --exclude=saneuser_home_dir.tar .
mv home_dir/saneuser_home_dir.tar .
up: build run ## Run container on port configured in `config.env` (Alias to run)
stop: ## Stop and remove a running container
docker stop $(APP_NAME); docker rm $(APP_NAME)
release: build-nc publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR
# Docker publish
publish: repo-login publish-latest publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR
publish-latest: tag-latest ## Publish the `latest` taged container to ECR
@echo 'publish latest to $(DOCKER_REPO)'
docker push $(DOCKER_REPO)/$(APP_NAME):latest
publish-version: tag-version ## Publish the `{version}` taged container to ECR
@echo 'publish $(VERSION) to $(DOCKER_REPO)'
docker push $(DOCKER_REPO)/$(APP_NAME):$(VERSION)
# Docker tagging
tag: tag-latest tag-version ## Generate container tags for the `{version}` ans `latest` tags
tag-latest: ## Generate container `{version}` tag
@echo 'create tag latest'
docker tag $(APP_NAME) $(DOCKER_REPO)/$(APP_NAME):latest
tag-version: ## Generate container `latest` tag
@echo 'create tag $(VERSION)'
docker tag $(APP_NAME) $(DOCKER_REPO)/$(APP_NAME):$(VERSION)
# HELPERS
# generate script to login to aws docker repo
CMD_REPOLOGIN := "eval $$\( aws ecr"
ifdef AWS_CLI_PROFILE
CMD_REPOLOGIN += " --profile $(AWS_CLI_PROFILE)"
endif
ifdef AWS_CLI_REGION
CMD_REPOLOGIN += " --region $(AWS_CLI_REGION)"
endif
CMD_REPOLOGIN += " get-login --no-include-email \)"
# login to AWS-ECR
repo-login: ## Auto login to AWS-ECR unsing aws-cli
@eval $(CMD_REPOLOGIN)
version: ## Output the current version
@echo $(VERSION)
Bootstrap: docker
From: whit2333/sane_db:latest
%post
mysql -u root -psane2008
#%environment
# NODE_ENV=development
# PORT=8000
# ALLOW_HTTP=true
# URL=localhost
# export NODE_ENV PORT ALLOW_HTTP URL
#%startscript
# ls
# Port to run the container
PORT=3306
InSANE_PREFIX=/usr/local
InSANEDIR=/opt/sane08/insane
InSANELOG=/opt/sane08/log
InSANE_DB_PATH=/opt/sane08/sane08_database/sqlite
#!/bin/bash
echo "0.1"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment