Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions job_templates/ci_job.xml.em
Original file line number Diff line number Diff line change
Expand Up @@ -361,24 +361,16 @@ setlocal enableDelayedExpansion
rmdir /S /Q ws workspace "work space"

echo "# BEGIN SECTION: Build DockerFile"
@# Rolling uses the Foxy Dockerfile.
if "!CI_ROS_DISTRO!" == "rolling" (
set "CI_ROS_DISTRO=foxy"
)
@# Eloquent uses the Dashing Dockerfile.
if "!CI_ROS_DISTRO!" == "eloquent" (
set "CI_ROS_DISTRO=dashing"
)
set CONTAINER_NAME=ros2_windows_ci_%CI_ROS_DISTRO%
set DOCKERFILE=windows_docker_resources\Dockerfile.%CI_ROS_DISTRO%
set DOCKERFILE=windows_docker_resources\Dockerfile

rem "Change dockerfile once per day to invalidate docker caches"
powershell "(Get-Content ${Env:DOCKERFILE}).replace('@@todays_date', $(Get-Date).ToLongDateString()) | Set-Content ${Env:DOCKERFILE}"

rem "Finding the Release Version is much easier with powershell than cmd"
powershell $(Get-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Update\TargetingInfo\Installed\Server.OS.amd64' -Name Version).Version > release_version.txt
set /p RELEASE_VERSION=< release_version.txt
set BUILD_ARGS=--build-arg WINDOWS_RELEASE_VERSION=%RELEASE_VERSION%
set BUILD_ARGS=--build-arg WINDOWS_RELEASE_VERSION=%RELEASE_VERSION% --build-arg ROS_DISTRO=%CI_ROS_DISTRO%
docker build %BUILD_ARGS% -t %CONTAINER_NAME% -f %DOCKERFILE% windows_docker_resources || exit /b !ERRORLEVEL!
echo "# END SECTION"

Expand Down
13 changes: 2 additions & 11 deletions job_templates/packaging_job.xml.em
Original file line number Diff line number Diff line change
Expand Up @@ -346,25 +346,16 @@ echo "# END SECTION"
setlocal enableDelayedExpansion
rmdir /S /Q ws workspace

echo "# BEGIN SECTION: Build DockerFile"
@# Rolling uses the Foxy Dockerfile.
if "!CI_ROS_DISTRO!" == "rolling" (
set "CI_ROS_DISTRO=foxy"
)
@# Eloquent uses the Dashing Dockerfile.
if "!CI_ROS_DISTRO!" == "eloquent" (
set "CI_ROS_DISTRO=dashing"
)
set CONTAINER_NAME=ros2_windows_ci_%CI_ROS_DISTRO%
set DOCKERFILE=windows_docker_resources\Dockerfile.%CI_ROS_DISTRO%%
set DOCKERFILE=windows_docker_resources\Dockerfile

rem "Change dockerfile once per day to invalidate docker caches"
powershell "(Get-Content ${Env:DOCKERFILE}).replace('@@todays_date', $(Get-Date).ToLongDateString()) | Set-Content ${Env:DOCKERFILE}"

rem "Finding the Release Version is much easier with powershell than cmd"
powershell $(Get-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Update\TargetingInfo\Installed\Server.OS.amd64' -Name Version).Version > release_version.txt
set /p RELEASE_VERSION=< release_version.txt
set BUILD_ARGS=--build-arg WINDOWS_RELEASE_VERSION=%RELEASE_VERSION%
set BUILD_ARGS=--build-arg WINDOWS_RELEASE_VERSION=%RELEASE_VERSION% --build-arg ROS_DISTRO=%CI_ROS_DISTRO%
docker build %BUILD_ARGS% -t %CONTAINER_NAME% -f %DOCKERFILE% windows_docker_resources || exit /b !ERRORLEVEL!
echo "# END SECTION"

Expand Down
19 changes: 14 additions & 5 deletions windows_docker_resources/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@
# $(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId
ARG WINDOWS_RELEASE_ID=1909

# In order to ensure the image is correctly compatible with the host system a
# more precise version than the release id is required. To find this value run
# the following in powershell.
# $(Get-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Update\TargetingInfo\Installed\Server.OS.amd64' -Name Version).Version"
# Fall back to the Release ID
ARG WINDOWS_RELEASE_VERSION=$WINDOWS_RELEASE_ID

# Indicates that the windows image will be used as the base image. Must be same or older than host.
# --isolation=hyperv is needed for both build/run if the image id is older than the host id
# Use --isolation=process if you need to build in a mounted volume
# FROM mcr.microsoft.com/windows:$WINDOWS_RELEASE_ID
FROM mcr.microsoft.com/windows@sha256:27f1a2a1f2f784f3716c2400d7e1bf93074a75e15f2974861c00275f93487c88
FROM mcr.microsoft.com/windows:$WINDOWS_RELEASE_VERSION

# Install cinc-solo, a compiled binary of chef-solo
RUN powershell "iex ((New-Object System.Net.WebClient).DownloadString('https://omnitruck.cinc.sh/install.ps1')); install -version 15.10.12"
Expand All @@ -28,7 +34,10 @@ COPY rticonnextdds-src\ C:\TEMP\rticonnextdds-src
RUN copy /b C:\TEMP\rticonnextdds-src\rti_connext_dds-5.3.1-pro-host-x64Win64.exe.??? C:\TEMP\rticonnextdds-src\rti_connext_dds-5.3.1-pro-host-x64Win64.exe
RUN copy /b C:\TEMP\rticonnextdds-src\rti_connext_dds-5.3.1-pro-target-x64Win64VS2017.rtipkg.??? C:\TEMP\rticonnextdds-src\rti_connext_dds-5.3.1-pro-target-x64Win64VS2017.rtipkg

COPY install_ros2.json C:\TEMP\
# ROS_DISTRO argument should be set to install dependencies for the target ROS version.
ARG ROS_DISTRO

COPY install_ros2_${ROS_DISTRO}.json C:\TEMP\
COPY solo.rb C:\TEMP\
COPY ros2-cookbooks\ C:\TEMP\ros2-cookbooks
COPY qtaccount\qtaccount.ini C:\TEMP\ros2-cookbooks\cookbooks\ros2_windows\files\
Expand All @@ -38,11 +47,11 @@ WORKDIR C:\TEMP\ros2-cookbooks\cookbooks\ros2_windows
RUN C:\opscode\chefdk\bin\berks vendor C:\TEMP\ros2-cookbooks\cookbooks

# Initial run
RUN c:\cinc-project\cinc\bin\cinc-solo.bat -c C:\TEMP\solo.rb -j C:\TEMP\install_ros2.json
RUN c:\cinc-project\cinc\bin\cinc-solo.bat -c C:\TEMP\solo.rb -j C:\TEMP\install_ros2_%ROS_DISTRO%.json

# Invalidate daily to run updates
RUN echo "@todays_date"
RUN c:\cinc-project\cinc\bin\cinc-solo.bat -c C:\TEMP\solo.rb -j C:\TEMP\install_ros2.json
RUN c:\cinc-project\cinc\bin\cinc-solo.bat -c C:\TEMP\solo.rb -j C:\TEMP\install_ros2_%ROS_DISTRO%.json

WORKDIR C:\ci
CMD ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat", "x86_amd64", "&&", `
Expand Down
55 changes: 0 additions & 55 deletions windows_docker_resources/Dockerfile.dashing

This file was deleted.

159 changes: 0 additions & 159 deletions windows_docker_resources/Dockerfile.foxy

This file was deleted.

22 changes: 22 additions & 0 deletions windows_docker_resources/install_ros2_dashing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"ros2_windows": {
"download_sources": "false",
"vs_version": "buildtools",
"ros2_ws": "C:/ci",
"ros_distro": "dashing",
"rti_connext": {
"target_platform": "x64Win64",
"min_vs_version": "2017",
"license_file": "C:/TEMP/rticonnextdds-license/rti_license.dat",
"installer_dir": "C:/TEMP/rticonnextdds-src",
"version": "5.3.1",
"edition": "pro",
"openssl_version": "1.0.2n"
}
},
"run_list": [
"recipe[ros2_windows::ros2]",
"recipe[ros2_windows::opensplice]",
"recipe[ros2_windows::rti_connext]"
]
}
22 changes: 22 additions & 0 deletions windows_docker_resources/install_ros2_eloquent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"ros2_windows": {
"download_sources": "false",
"vs_version": "buildtools",
"ros2_ws": "C:/ci",
"ros_distro": "eloquent",
"rti_connext": {
"target_platform": "x64Win64",
"min_vs_version": "2017",
"license_file": "C:/TEMP/rticonnextdds-license/rti_license.dat",
"installer_dir": "C:/TEMP/rticonnextdds-src",
"version": "5.3.1",
"edition": "pro",
"openssl_version": "1.0.2n"
}
},
"run_list": [
"recipe[ros2_windows::ros2]",
"recipe[ros2_windows::opensplice]",
"recipe[ros2_windows::rti_connext]"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"download_sources": "false",
"vs_version": "buildtools",
"ros2_ws": "C:/ci",
"ros_distro": "foxy",
"rti_connext": {
"target_platform": "x64Win64",
"min_vs_version": "2017",
Expand Down
22 changes: 22 additions & 0 deletions windows_docker_resources/install_ros2_rolling.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"ros2_windows": {
"download_sources": "false",
"vs_version": "buildtools",
"ros2_ws": "C:/ci",
"ros_distro": "rolling",
"rti_connext": {
"target_platform": "x64Win64",
"min_vs_version": "2017",
"license_file": "C:/TEMP/rticonnextdds-license/rti_license.dat",
"installer_dir": "C:/TEMP/rticonnextdds-src",
"version": "5.3.1",
"edition": "pro",
"openssl_version": "1.0.2n"
}
},
"run_list": [
"recipe[ros2_windows::ros2]",
"recipe[ros2_windows::opensplice]",
"recipe[ros2_windows::rti_connext]"
]
}
Loading