-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Blake Devcich <[email protected]>
- Loading branch information
Showing
5 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM debian:stable-slim | ||
|
||
WORKDIR / | ||
COPY scripts/ . | ||
|
||
CMD ["/default.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Image URL to use all building/pushing image targets | ||
#IMG ?= ghcr.io/nearnodeflash/nnf-remora:0.0.1 | ||
IMG ?= devcich/nnf-remora:0.0.2 | ||
|
||
# CONTAINER_TOOL defines the container tool to be used for building images. | ||
# Be aware that the target commands are only tested with Docker which is | ||
# scaffolded by default. However, you might want to replace it to use other | ||
# tools. (i.e. podman) | ||
CONTAINER_TOOL ?= docker | ||
|
||
.PHONY: docker-build | ||
docker-build: ## Build docker image with the manager. | ||
$(CONTAINER_TOOL) build -t ${IMG} . | ||
|
||
.PHONY: docker-push | ||
docker-push: ## Push docker image with the manager. | ||
$(CONTAINER_TOOL) _push ${IMG} | ||
|
||
.PHONY: kind-push | ||
kind-push: ## Push docker image to kind | ||
kind load docker-image ${IMG} | ||
|
||
# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple | ||
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to: | ||
# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/ | ||
# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/ | ||
# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=<myregistry/image:<tag>> then the export will fail) | ||
# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option. | ||
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le | ||
.PHONY: docker-buildx | ||
docker-buildx: ## Build and push docker image for the manager for cross-platform support | ||
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile | ||
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross | ||
- $(CONTAINER_TOOL) buildx create --name project-v3-builder | ||
$(CONTAINER_TOOL) buildx use project-v3-builder | ||
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross . | ||
- $(CONTAINER_TOOL) buildx rm project-v3-builder | ||
rm Dockerfile.cross |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# ./copy-in.sh /lus/global test-MYUSER 1050 1051 test.in | ||
|
||
ROOTDIR=$1 | ||
MYUSER=$2 | ||
MYUID=$3 | ||
MYGID=$4 | ||
FILE=$5 | ||
|
||
# mkdir -p /lus/global/mpiuser | ||
# cp /usr/bin/perl /lus/global/mpiuser/test.in | ||
# chown -R 1050:1051 /lus/global/mpiuser | ||
# ls -l /lus/global/mpiuser | ||
|
||
mkdir -p "$ROOTDIR"/"$MYUSER" | ||
cp /usr/bin/perl "$ROOTDIR"/"$MYUSER"/"$FILE" | ||
# TODO md5sum | ||
chown -R "$MYUID":"$MYGID" "$ROOTDIR"/"$MYUSER" | ||
ls -alhR "$ROOTDIR"/"$MYUSER" #&>"$ROOTDIR"/"$MYUSER"/test.output | ||
|
||
set +e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
echo "No script selected. Exiting." |