Skip to content

Commit d71ade6

Browse files
Merge branch develop into main [2023_09_07] (#175)
* Agent: Support for building an Ubuntu Core snap. * Support Ubuntu 22.04 and Debian 11 builds. * Agent: Replace boost::filesystem usage with std::filesystem. * SDK (Windows): Preview additional methods for partial downloads, streaming downloads, and download properties. * bootstrap script determines OS and version on its own. * Fix issue of non-existent /include path during bootstrap and/or build.
2 parents df639ab + 5c090ee commit d71ade6

File tree

91 files changed

+2733
-1189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2733
-1189
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,7 @@ _deps
5656
*_CPack_Packages/
5757
*.deb
5858
out/
59+
60+
# Ubuntu Snap files
61+
*.snap
62+
snap/

CMakeLists.txt

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ option (DO_INCLUDE_PLUGINS "Build subproject plugins" OFF)
1515
option (DO_INCLUDE_SDK "Build subproject sdk-cpp" OFF)
1616

1717
option (DO_BUILD_TESTS "Set DO_BUILD_TESTS to OFF to skip building tests." ON)
18-
19-
set(CMAKE_CXX_STANDARD 14)
20-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
21-
set(CMAKE_CXX_EXTENSIONS OFF)
18+
option (DO_BUILD_FOR_SNAP "Enable DO Snap build option" OFF)
2219

2320
# Get verbose output from cmake generation and build steps
2421
set(CMAKE_VERBOSE_MAKEFILE ON)
@@ -61,6 +58,16 @@ else()
6158
message(FATAL_ERROR "Unknown platform for client")
6259
endif()
6360

61+
# C++17 is required to use std::filesystem but Edge builds on Windows is not ready to move up yet.
62+
# Luckily, we do not need std::filesystem on Windows.
63+
if (DO_INCLUDE_SDK AND DO_PLATFORM_WINDOWS)
64+
set(CMAKE_CXX_STANDARD 14)
65+
else ()
66+
set(CMAKE_CXX_STANDARD 17)
67+
endif ()
68+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
69+
set(CMAKE_CXX_EXTENSIONS OFF)
70+
6471
# PIC (Position Independent Code) ensures .a files can be linked to executables that have PIE enabled
6572
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
6673

@@ -82,7 +89,14 @@ if (DO_PLATFORM_LINUX)
8289
# (Enable --trace-expand in cmake and look at lines from boost_headers-config.cmake and its callers.)
8390
# Workaround: force cmake to look in "/usr" since the /lib and /bin paths are either
8491
# not relevant for our usage or they are symlinks to /usr/lib and /usr/bin.
85-
set(CMAKE_PREFIX_PATH "/usr")
92+
if (IS_SYMLINK "/lib" AND NOT EXISTS "/include")
93+
if (CMAKE_PREFIX_PATH)
94+
message (WARNING "/lib is a symlink and /include does not exist. CMAKE_PREFIX_PATH is already set, not overriding it.")
95+
else ()
96+
message (WARNING "/lib is a symlink and /include does not exist. Updating CMAKE_PREFIX_PATH to /usr.")
97+
set(CMAKE_PREFIX_PATH "/usr")
98+
endif ()
99+
endif ()
86100
endif (DO_PLATFORM_LINUX)
87101

88102
if (DO_PLATFORM_WINDOWS AND DO_INCLUDE_SDK)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ This will handle installing to the appropriate paths, and also the necessary set
102102
> cd /tmp/build-deliveryoptimization-agent/linux-debug/
103103
> sudo apt-get install ./deliveryoptimization-agent*.deb
104104
> cd /tmp/build-deliveryoptimization-plugin-apt/linux-debug/
105-
> sudo apt get install ./deliveryoptimization-plugin-apt*.deb
105+
> sudo apt-get install ./deliveryoptimization-plugin-apt*.deb
106106
```
107107

108108
2. If you build and install using cmake, or through some other custom means, be sure to setup the DO user/groups correctly in your installation.

azure-pipelines/build/linux/du/docker/doclient-lite-docker.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,31 @@ jobs:
3333

3434
- template: ../templates/do-docker-jobs.yml
3535
parameters:
36-
targetOsArch: 'debian10_arm64'
36+
targetOsArch: 'debian10_arm64' # azure pipelines does not support '.' in display names
3737
imageVersion: ${{variables.containerImageVersion}}
3838
stepsTemplate: 'doclient-lite-docker-steps.yml'
3939

4040
- template: ../templates/do-docker-jobs.yml
4141
parameters:
42-
targetOsArch: 'debian10_x64'
42+
targetOsArch: 'debian10_x64' # azure pipelines does not support '.' in display names
43+
imageVersion: ${{variables.containerImageVersion}}
44+
stepsTemplate: 'doclient-lite-docker-steps.yml'
45+
46+
- template: ../templates/do-docker-jobs.yml
47+
parameters:
48+
targetOsArch: 'debian11_arm32' # azure pipelines does not support '.' in display names
49+
imageVersion: ${{variables.containerImageVersion}}
50+
stepsTemplate: 'doclient-lite-docker-steps.yml'
51+
52+
- template: ../templates/do-docker-jobs.yml
53+
parameters:
54+
targetOsArch: 'debian11_arm64' # azure pipelines does not support '.' in display names
55+
imageVersion: ${{variables.containerImageVersion}}
56+
stepsTemplate: 'doclient-lite-docker-steps.yml'
57+
58+
- template: ../templates/do-docker-jobs.yml
59+
parameters:
60+
targetOsArch: 'debian11_x64' # azure pipelines does not support '.' in display names
4361
imageVersion: ${{variables.containerImageVersion}}
4462
stepsTemplate: 'doclient-lite-docker-steps.yml'
4563

@@ -61,3 +79,14 @@ jobs:
6179
imageVersion: ${{variables.containerImageVersion}}
6280
stepsTemplate: 'doclient-lite-docker-steps.yml'
6381

82+
- template: ../templates/do-docker-jobs.yml
83+
parameters:
84+
targetOsArch: 'ubuntu2204_arm64' # azure pipelines does not support '.' in display names
85+
imageVersion: ${{variables.containerImageVersion}}
86+
stepsTemplate: 'doclient-lite-docker-steps.yml'
87+
88+
- template: ../templates/do-docker-jobs.yml
89+
parameters:
90+
targetOsArch: 'ubuntu2204_x64' # azure pipelines does not support '.' in display names
91+
imageVersion: ${{variables.containerImageVersion}}
92+
stepsTemplate: 'doclient-lite-docker-steps.yml'

azure-pipelines/build/linux/du/docker/dopapt-docker.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@ jobs:
4343
imageVersion: ${{variables.containerImageVersion}}
4444
stepsTemplate: 'dopapt-docker-steps.yml'
4545

46+
- template: ../templates/do-docker-jobs.yml
47+
parameters:
48+
targetOsArch: 'debian11_arm32'
49+
imageVersion: ${{variables.containerImageVersion}}
50+
stepsTemplate: 'dopapt-docker-steps.yml'
51+
52+
- template: ../templates/do-docker-jobs.yml
53+
parameters:
54+
targetOsArch: 'debian11_arm64'
55+
imageVersion: ${{variables.containerImageVersion}}
56+
stepsTemplate: 'dopapt-docker-steps.yml'
57+
58+
- template: ../templates/do-docker-jobs.yml
59+
parameters:
60+
targetOsArch: 'debian11_x64'
61+
imageVersion: ${{variables.containerImageVersion}}
62+
stepsTemplate: 'dopapt-docker-steps.yml'
63+
4664
- template: ../templates/do-docker-jobs.yml
4765
parameters:
4866
targetOsArch: 'ubuntu1804_arm64'
@@ -61,3 +79,14 @@ jobs:
6179
imageVersion: ${{variables.containerImageVersion}}
6280
stepsTemplate: 'dopapt-docker-steps.yml'
6381

82+
- template: ../templates/do-docker-jobs.yml
83+
parameters:
84+
targetOsArch: 'ubuntu2204_arm64'
85+
imageVersion: ${{variables.containerImageVersion}}
86+
stepsTemplate: 'dopapt-docker-steps.yml'
87+
88+
- template: ../templates/do-docker-jobs.yml
89+
parameters:
90+
targetOsArch: 'ubuntu2204_x64'
91+
imageVersion: ${{variables.containerImageVersion}}
92+
stepsTemplate: 'dopapt-docker-steps.yml'

azure-pipelines/build/linux/du/docker/dosdkcpp-docker.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@ jobs:
4343
imageVersion: ${{variables.containerImageVersion}}
4444
stepsTemplate: 'dosdkcpp-docker-steps.yml'
4545

46+
- template: ../templates/do-docker-jobs.yml
47+
parameters:
48+
targetOsArch: 'debian11_arm32'
49+
imageVersion: ${{variables.containerImageVersion}}
50+
stepsTemplate: 'dosdkcpp-docker-steps.yml'
51+
52+
- template: ../templates/do-docker-jobs.yml
53+
parameters:
54+
targetOsArch: 'debian11_arm64'
55+
imageVersion: ${{variables.containerImageVersion}}
56+
stepsTemplate: 'dosdkcpp-docker-steps.yml'
57+
58+
- template: ../templates/do-docker-jobs.yml
59+
parameters:
60+
targetOsArch: 'debian11_x64'
61+
imageVersion: ${{variables.containerImageVersion}}
62+
stepsTemplate: 'dosdkcpp-docker-steps.yml'
63+
4664
- template: ../templates/do-docker-jobs.yml
4765
parameters:
4866
targetOsArch: 'ubuntu1804_arm64'
@@ -60,3 +78,15 @@ jobs:
6078
targetOsArch: 'ubuntu2004_x64'
6179
imageVersion: ${{variables.containerImageVersion}}
6280
stepsTemplate: 'dosdkcpp-docker-steps.yml'
81+
82+
- template: ../templates/do-docker-jobs.yml
83+
parameters:
84+
targetOsArch: 'ubuntu2204_arm64'
85+
imageVersion: ${{variables.containerImageVersion}}
86+
stepsTemplate: 'dosdkcpp-docker-steps.yml'
87+
88+
- template: ../templates/do-docker-jobs.yml
89+
parameters:
90+
targetOsArch: 'ubuntu2204_x64'
91+
imageVersion: ${{variables.containerImageVersion}}
92+
stepsTemplate: 'dosdkcpp-docker-steps.yml'

azure-pipelines/build/linux/du/templates/doclient-lite-docker-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ steps:
1414
displayName: Login to ACR
1515
inputs:
1616
command: login
17-
containerRegistry: doclientcontainerregistry
17+
containerRegistry: doclient-dockercontainerregistry-buildpipeline # name of the service connection that connect the pipeline to the ACR
1818
repository: $(parameters.targetOsArch)
1919

2020
- task: Docker@2
2121
displayName: Pull latest build image
2222
inputs:
2323
command: pull
24-
containerRegistry: doclientcontainerregistry
24+
containerRegistry: doclient-dockercontainerregistry-buildpipeline # name of the service connection that connect the pipeline to the ACR
2525
arguments: 'doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:${{parameters.imageVersion}}'
2626

2727
- task: CmdLine@2

azure-pipelines/build/linux/du/templates/doclient-lite-native-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ steps:
2424
inputs:
2525
targetType: 'filePath'
2626
filePath: 'build/scripts/check_binary_size.sh'
27-
arguments: '1251928 /tmp/build-deliveryoptimization-agent/linux-${{parameters.config}}/client-lite/deliveryoptimization-agent'
27+
arguments: '523672 /tmp/build-deliveryoptimization-agent/linux-${{parameters.config}}/client-lite/deliveryoptimization-agent'
2828
displayName: 'Limit binary size increase'
2929

3030
- task: CmdLine@2

azure-pipelines/build/linux/du/templates/dopapt-docker-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ steps:
1414
displayName: Login to ACR
1515
inputs:
1616
command: login
17-
containerRegistry: doclientcontainerregistry
17+
containerRegistry: doclient-dockercontainerregistry-buildpipeline # name of the service connection that connect the pipeline to the ACR
1818
repository: $(parameters.targetOsArch)
1919

2020
- task: Docker@2
2121
displayName: Pull latest build image
2222
inputs:
2323
command: pull
24-
containerRegistry: doclientcontainerregistry
24+
containerRegistry: doclient-dockercontainerregistry-buildpipeline # name of the service connection that connect the pipeline to the ACR
2525
arguments: 'doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:${{parameters.imageVersion}}'
2626

2727
- task: CmdLine@2

azure-pipelines/build/linux/du/templates/dosdkcpp-docker-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ steps:
1414
displayName: Login to ACR
1515
inputs:
1616
command: login
17-
containerRegistry: doclientcontainerregistry
17+
containerRegistry: doclient-dockercontainerregistry-buildpipeline # name of the service connection that connect the pipeline to the ACR
1818
repository: $(parameters.targetOsArch)
1919

2020
- task: Docker@2
2121
displayName: Pull latest build image
2222
inputs:
2323
command: pull
24-
containerRegistry: doclientcontainerregistry
24+
containerRegistry: doclient-dockercontainerregistry-buildpipeline # name of the service connection that connect the pipeline to the ACR
2525
arguments: 'doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:${{parameters.imageVersion}}'
2626

2727
- task: CmdLine@2

0 commit comments

Comments
 (0)