Skip to content

Commit

Permalink
exec format error when deploying
Browse files Browse the repository at this point in the history
Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Oct 17, 2023
1 parent c421acb commit 00fbf3c
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,21 @@ func (t *T) WithGlobalLustreFromPersistentLustre(name string, namespaces []strin
namespaces: lustreNamespaces,
}

// For copy_in/copy_out, pull the source/destination paths and add them to global lustre
for _, directive := range t.directives {
args, _ := dwdparse.BuildArgsMap(directive)

if args["command"] == "copy_in" {
if path, found := args["source"]; found {
t.options.globalLustre.in = path
}
} else if args["command"] == "copy_out" {
if path, found := args["destination"]; found {
t.options.globalLustre.out = path
}
}
}

return t.WithLabels("global_lustre")
}

Expand Down
6 changes: 6 additions & 0 deletions remora/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:stable-slim

WORKDIR /
COPY scripts/ .

CMD ["/default.sh"]
38 changes: 38 additions & 0 deletions remora/Makefile
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
24 changes: 24 additions & 0 deletions remora/scripts/copy-in.sh
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
3 changes: 3 additions & 0 deletions remora/scripts/default.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo "No script selected. Exiting."

0 comments on commit 00fbf3c

Please sign in to comment.