diff --git a/.gitattributes b/.gitattributes index 6fee892..2e99976 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,5 @@ *.cmd text eol=crlf *.bat text eol=crlf *.ps1 text eol=crlf +*.xdt text eol=crlf +*.nuspec text eol=crlf diff --git a/.gitignore b/.gitignore index 697527a..2f42d9f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ var/ *.egg-info/ .installed.cfg *.egg +*.nupkg # PyInstaller # Usually these files are written by a python script from a template diff --git a/site-extension/applicationHost.xdt b/site-extension/applicationHost.xdt new file mode 100644 index 0000000..a4a94d0 --- /dev/null +++ b/site-extension/applicationHost.xdt @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/site-extension/batch-shipyard.nuspec b/site-extension/batch-shipyard.nuspec new file mode 100644 index 0000000..c576b53 --- /dev/null +++ b/site-extension/batch-shipyard.nuspec @@ -0,0 +1,21 @@ + + + + batch-shipyard + 0.0.1.8 + Batch Shipyard + Fred Park + true + Execute jobs on Azure Batch via Batch Shipyard. Requires Python. + https://azurecomcdn.azureedge.net/cvt-351112a289cff390998cc55a66a04f540f6cecfdeffbeac6a482ab886a841f7c/images/page/services/batch/100x-scale.png + https://github.com/Azure/batch-shipyard + https://github.com/Azure/batch-shipyard/blob/master/LICENSE + Microsoft + https://github.com/Azure/batch-shipyard/blob/master/CHANGELOG.md + azure batch shipyard docker containers python + + + + + + diff --git a/site-extension/install.cmd b/site-extension/install.cmd new file mode 100644 index 0000000..fabd1d0 --- /dev/null +++ b/site-extension/install.cmd @@ -0,0 +1,49 @@ +@echo off + +REM get installed python exe and dir +pushd %HOME%\python* +SET PYTHONHOME=%cd% +SET PYTHON=%PYTHONHOME%\python.exe +IF NOT EXIST "%PYTHON%" ( + echo "%PYTHON%" does not exist! + exit /b 1 +) +popd + +REM ensure git is in path +where git.exe +IF %ERRORLEVEL% NEQ 0 ( + echo "git not found" + exit /b 1 +) + +REM git clone repo +taskkill /F /IM python.exe +SET CLONEDIR=%HOME%\batch-shipyard +IF EXIST "%CLONEDIR%" ( + rd /s /q "%CLONEDIR%" +) +git clone "https://github.com/Azure/batch-shipyard.git" "%CLONEDIR%" +IF %ERRORLEVEL% NEQ 0 ( + echo "git clone failed" + exit /b 1 +) + +REM create cmd file +(echo @echo off) > "%CLONEDIR%\shipyard.cmd" +(echo SET PYTHON=%PYTHON%) >> "%CLONEDIR%\shipyard.cmd" +type shipyard.cmd >> "%CLONEDIR%\shipyard.cmd" + +REM install requirements +pushd "%CLONEDIR%" +"%PYTHON%" -m pip install --upgrade appdirs packaging six +IF %ERRORLEVEL% NEQ 0 ( + echo "pip install pre-requisites failed" + exit /b 1 +) +"%PYTHON%" -m pip install --upgrade -r requirements.txt +IF %ERRORLEVEL% NEQ 0 ( + echo "pip install requirements.txt failed" + exit /b 1 +) +popd diff --git a/site-extension/shipyard.cmd b/site-extension/shipyard.cmd new file mode 100644 index 0000000..401afd2 --- /dev/null +++ b/site-extension/shipyard.cmd @@ -0,0 +1,3 @@ +setlocal enabledelayedexpansion + +"%PYTHON%" -u "%HOME%\batch-shipyard\shipyard.py" \ No newline at end of file diff --git a/site-extension/uninstall.cmd b/site-extension/uninstall.cmd new file mode 100644 index 0000000..d4f1818 --- /dev/null +++ b/site-extension/uninstall.cmd @@ -0,0 +1,9 @@ +@echo off +setlocal enabledelayedexpansion + +REM kill any python.exe running +taskkill /F /IM python.exe +SET CLONEDIR=%HOME%\batch-shipyard +IF EXIST "%CLONEDIR%" ( + rd /s /q "%CLONEDIR%" +)