Skip to content

Commit 088a40a

Browse files
author
lucas iscovici
committed
mlds-notebook-Sam 9 jui 2018 03:37:15 CEST
1 parent be04c88 commit 088a40a

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

bashCmd.zip

81 Bytes
Binary file not shown.

bashCmd/Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ define shell-functions
88

99
: END
1010
endef
11-
11+
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
12+
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
1213
# Generate the file with function declarations for the shell
13-
$(shell sed -n '/^: BEGIN/,/^: END/p' ./Makefile > .functions.sh && chmod 777 .functions.sh)
14+
$(shell sed -n '/^: BEGIN/,/^: END/p' "${mkfile_path}" > .functions.sh && chmod 777 .functions.sh)
1415

1516
SHELL := /bin/bash --init-file .functions.sh -i
1617

@@ -106,7 +107,7 @@ help:
106107
107108
mlds:
108109
@if [[ -z "${help}" || ( "${help}" != "no" && "${help}" != "false" && "${help}" != "f") ]]; then \
109-
make help; \
110+
make -f "${mkfile_path}" help; \
110111
else if [[ $(shell echo \"$(shell test -f "getP" && echo "true" || echo "false")\") = "true" ]]; then \
111112
getP=./getP ;\
112113
elif [[ $(shell test -f \"../getP\" && echo \"true\" || echo \"false\") = "true" ]];then \
@@ -127,7 +128,7 @@ h=$$($$getP ${portSparkRestMin} ${portSparkRestMax} 2> /dev/null) && \
127128
i=$$(($$g+${portSparkContextENbX})) && \
128129
l=$$(($$c+${portH2oNbX})) && \
129130
test -z $$getP && echo "Error ------ getP" || (\
130-
(test ${printCommand} = "yes" && test "${quiet}" = "noj" ) && echo 'docker run ${jname} "${debug}" "${run_rm}" ${j} ${jj} -p "'$$( echo $$d)':${portSpark}" -p "'$$( echo $$g)'-'$$( echo $$i)':${portSparkContextB}-${portSparkContextE}" -p "'$$( echo $$h)':${portSparkRest}" -p "'$$( echo $$f)':${portSparkSlave}" -p "'$$( echo $$e)':${portSparkMaster}" -p "'$$( echo $$a)':${portNb}" -p "'$$( echo $$b)':${portTensorBoard}" -p "'$$( echo $$c)'-'$$( echo $$l)':${portH2o}" ${more} "${image}" ${cmd}' || true ) && make a=$$a b=$$b c=$$c d=$$d e=$$e f=$$f g=$$g h=$$h i=$$i l=$$l _mlds; \
131+
(test ${printCommand} = "yes" && test "${quiet}" = "noj" ) && echo 'docker run ${jname} "${debug}" "${run_rm}" ${j} ${jj} -p "'$$( echo $$d)':${portSpark}" -p "'$$( echo $$g)'-'$$( echo $$i)':${portSparkContextB}-${portSparkContextE}" -p "'$$( echo $$h)':${portSparkRest}" -p "'$$( echo $$f)':${portSparkSlave}" -p "'$$( echo $$e)':${portSparkMaster}" -p "'$$( echo $$a)':${portNb}" -p "'$$( echo $$b)':${portTensorBoard}" -p "'$$( echo $$c)'-'$$( echo $$l)':${portH2o}" ${more} "${image}" ${cmd}' || true ) && make -f "${mkfile_path}" a=$$a b=$$b c=$$c d=$$d e=$$e f=$$f g=$$g h=$$h i=$$i l=$$l _mlds; \
131132
fi
132133
133134
_mlds:

bashCmd/envStart.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ else
3737
alias _exit="builtin exit"
3838
alias _docker="docker"
3939
export _dockerP=$(which docker)
40-
export PATH="$(pwd):$PATH";
40+
export PATH="$(which envStart.sh)/cmd:$PATH";
4141
export OLD_PS1="SETTED";
4242
if _check.sh "$sl"; then
4343
curr="*"

bashCmd/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ dkd="$(confImgRun.sh)"
44
# echo "DEBUG $dkd"
55
pdof=\"$(cat .mldsEnv | sed -En "/^__.*/p" | sed -En "s/__(.*)/\1/p" | tr '\n' ' ')\"
66

7-
#echo make mlds $(echo $dkd | tr -d '"' ) $(echo $pdof | tr -d '"' ) $@
8-
make mlds -f "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/Makefile" $(echo $pdof | tr -d '"' ) $(echo $dkd | tr -d '"' ) "$@"
7+
echo make -f "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/Makefile" mlds
8+
make mlds -f "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/Makefile" mlds $(echo $pdof | tr -d '"' ) $(echo $dkd | tr -d '"' ) "$@"
99

1010
else
1111

mlds-notebook-bashCmd.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
. ~/.bashrc
33
if [[ -n `which curl` ]];then
4-
rm -rf bashCmd.zip && rm -rf bashCmd && curl -s https://raw.githubusercontent.com/luluperet/mlds-notebook/master/bashCmd.zip -o bashCmd.zip && unzip -q bashCmd.zip && rm -rf bashCmd.zip && ( [[ ! -d ~/.mlds ]] && mkdir ~/.mlds || true) && mv bashCmd/* ~/.mlds/ && ([[ -z "$(which envStart.sh)" ]] && ( echo "PATH=$HOME/.mlds:$PATH" >> ~/.bashrc && export PATH="$HOME/.mlds:$PATH") || true ) && rm -rf bashCmd && echo -e 'BashCmd installed !!!\nFor begin to Work:\n\t$ ./envStart.sh <name_futur_container_u_want>\nFor see help:\n\t$ make or $ make help or $ make mlds help=\n' || echo "pb"
4+
rm -rf bashCmd.zip && rm -rf bashCmd && curl -s https://raw.githubusercontent.com/luluperet/mlds-notebook/master/bashCmd.zip -o bashCmd.zip && unzip -q bashCmd.zip && rm -rf bashCmd.zip && ( [[ ! -d ~/.mlds || ! -d ~/.mlds/cmd ]] && mkdir -p ~/.mlds/cmd || true) && mv bashCmd/* ~/.mlds/cmd && mv ~/.mlds/cmd/envStart.sh ~/.mlds/ && ([[ -z "$(which envStart.sh)" ]] && ( echo "PATH=$HOME/.mlds:$PATH" >> ~/.bashrc && export PATH="$HOME/.mlds:$PATH") || true ) && rm -rf bashCmd && echo -e 'BashCmd installed !!!\nFor begin to Work:\n\t$ ./envStart.sh <name_futur_container_u_want>\nFor see help:\n\t$ make or $ make help or $ make mlds help=\n' || echo "pb"
55
else
66
echo "OU EST CURL !!!"
77
fi

0 commit comments

Comments
 (0)