1
0
Fork 0

installed gsutils in container

This commit is contained in:
Christian Kühnel 2019-12-20 11:07:09 +00:00
parent bf1bcb951f
commit 4f4bcc7f65
4 changed files with 37 additions and 33 deletions

View file

@ -14,13 +14,12 @@ RUN powershell -NoProfile -InputFormat None -Command `
Invoke-WebRequest -Uri %SWARM_PLUGIN_URL% -OutFile %SWARM_PLUGIN_JAR% Invoke-WebRequest -Uri %SWARM_PLUGIN_URL% -OutFile %SWARM_PLUGIN_JAR%
# install gsutils to access Google Cloud Storage # install gsutils to access Google Cloud Storage
RUN powershell -NoProfile -InputFormat None -Command ` RUN pip install gsutil
(New-Object Net.WebClient).DownloadFile("https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe", "$env:Temp\GoogleCloudSDKInstaller.exe") ; `
& $env:Temp\GoogleCloudSDKInstaller.exe ; `
del $env:Temp\GoogleCloudSDKInstaller.exe
VOLUME C:\credentials VOLUME C:\credentials
# temporary directory, can be mounted on host if required
VOLUME C:\Temp VOLUME C:\Temp
# start swarm plugin # start swarm plugin
COPY start_agent.bat c:\jenkins COPY start_agent.ps1 c:\jenkins
CMD c:\jenkins\start_agent.bat CMD powershell c:\jenkins\start_agent.ps1

View file

@ -1,26 +0,0 @@
@rem Copyright 2019 Google LLC
@rem
@rem Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://llvm.org/LICENSE.txt
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
set JENKINS_SERVER=jenkins.local
set AGENT_ROOT=C:\ws
set WORKSPACE=%AGENT_ROOT%\workspace
@rem authenticate gsutil
gcloud auth activate-service-account --key-file C:\credentials\build-agent-results_key.json
set TEMP=C:\TEMP
set TMP=%TEMP%
java -jar %SWARM_PLUGIN_JAR% -master http://%JENKINS_SERVER%:8080 -executors 1 -fsroot %AGENT_ROOT% -labels windows

View file

@ -0,0 +1,31 @@
# Copyright 2019 Google LLC
#
# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
$JENKINS_SERVER="jenkins.local"
$AGENT_ROOT="C:\ws"
# authenticate gsutil
# gcloud auth activate-service-account --key-file C:\credentials\build-agent-results_key.json
Write-Output "C:\credentials\build-agent-results_key.json`nllvm-premerge-checks`n`n" | gsutil config -e
$env:TEMP="C:\TEMP"
$env:TMP="${env:TEMP}"
java -jar ${env:SWARM_PLUGIN_JAR} `
-master http://${JENKINS_SERVER}:8080 `
-executors 1 `
-fsroot ${AGENT_ROOT} `
-labels windows `
-name ${env:PARENT_HOSTNAME}

View file

@ -29,7 +29,7 @@ If ($LastExitCode -ne 0) {
} }
# mount a persistent workspace for experiments # mount a persistent workspace for experiments
docker run -it -v D:\:C:\ws -v C:\credentials:C:\credentials $IMAGE_NAME $CMD docker run -it -v D:\:C:\ws -v C:\credentials:C:\credentials -e PARENT_HOSTNAME=$env:computername $IMAGE_NAME $CMD
If ($LastExitCode -ne 0) { If ($LastExitCode -ne 0) {
exit exit
} }