diff --git a/azure-pipelines/build/doclient-lite-docker.yml b/azure-pipelines/build/doclient-lite-docker.yml index 596e1405..05865b49 100644 --- a/azure-pipelines/build/doclient-lite-docker.yml +++ b/azure-pipelines/build/doclient-lite-docker.yml @@ -14,26 +14,28 @@ schedules: include: - main -pool: dotestlab +# TODO(jimson): Provision a 1ES managed image with artifacts that have all our dependencies preinstalled +#pool: 1es_hosted_pool_ubuntu_1804 + +# The microsoft-hosted agents come with docker preinstalled, the caveat being that the bootstrap script needs to be called to provision everything else +pool: + vmImage: 'ubuntu-18.04' jobs: - template: templates/do-docker-jobs.yml parameters: - targetOS: 'debian10' + targetOS: 'debian9' targetArch: 'arm32' - dockerImageName: 'jimsonmsft/debian10-arm32:latest' stepsTemplate: 'doclient-lite-docker-steps.yml' - template: templates/do-docker-jobs.yml parameters: - targetOS: 'debian9' + targetOS: 'debian10' targetArch: 'arm32' - dockerImageName: 'jimsonmsft/debian9-arm32:latest' stepsTemplate: 'doclient-lite-docker-steps.yml' - template: templates/do-docker-jobs.yml parameters: - targetOS: 'ubuntu1804' + targetOS: 'ubuntu1804' # azure pipelines does not support '.' in display names targetArch: 'arm64' - dockerImageName: 'jimsonmsft/ubuntu18.04-arm64:latest' stepsTemplate: 'doclient-lite-docker-steps.yml' diff --git a/azure-pipelines/build/doclient-lite-native.yml b/azure-pipelines/build/doclient-lite-native.yml index dd95792d..ab86af44 100644 --- a/azure-pipelines/build/doclient-lite-native.yml +++ b/azure-pipelines/build/doclient-lite-native.yml @@ -37,13 +37,16 @@ pr: exclude: - azure-pipelines/* -pool: dotestlab +# TODO(jimson): This is a base Ubuntu 1804 Image right now, switch to an image that contains all our dependencies preinstalled +# The advantage to using this over the Microsoft-hosted agent is parallel execution of jobs (infinite # of vms can be spun up at execution time) +pool: 1es_hosted_pool_ubuntu_1804 jobs: - job: Debug steps: - template: templates/doclient-lite-native-steps.yml parameters: + targetOS: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: debug @@ -51,6 +54,7 @@ jobs: steps: - template: templates/doclient-lite-native-steps.yml parameters: + targetOS: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: minsizerel skipTests: true diff --git a/azure-pipelines/build/dopapt-docker.yml b/azure-pipelines/build/dopapt-docker.yml index 636011d8..356600fd 100644 --- a/azure-pipelines/build/dopapt-docker.yml +++ b/azure-pipelines/build/dopapt-docker.yml @@ -14,26 +14,28 @@ schedules: include: - main -pool: dotestlab +# TODO(jimson): Provision a 1ES managed image with artifacts that have all our dependencies preinstalled +#pool: 1es_hosted_pool_ubuntu_1804 + +# The microsoft-hosted agents come with docker preinstalled, the caveat being that the bootstrap script needs to be called to provision everything else +pool: + vmImage: 'ubuntu-18.04' jobs: - template: templates/do-docker-jobs.yml parameters: targetOS: 'debian10' targetArch: 'arm32' - dockerImageName: 'jimsonmsft/debian10-arm32:latest' stepsTemplate: 'dopapt-docker-steps.yml' - template: templates/do-docker-jobs.yml parameters: targetOS: 'debian9' targetArch: 'arm32' - dockerImageName: 'jimsonmsft/debian9-arm32:latest' stepsTemplate: 'dopapt-docker-steps.yml' - template: templates/do-docker-jobs.yml parameters: targetOS: 'ubuntu1804' targetArch: 'arm64' - dockerImageName: 'jimsonmsft/ubuntu18.04-arm64:latest' stepsTemplate: 'dopapt-docker-steps.yml' diff --git a/azure-pipelines/build/dopapt-native.yml b/azure-pipelines/build/dopapt-native.yml index aa5b4dda..35dab9c0 100644 --- a/azure-pipelines/build/dopapt-native.yml +++ b/azure-pipelines/build/dopapt-native.yml @@ -39,13 +39,16 @@ pr: - 'azure-pipelines/*' - 'plugins/linux-apt/scripts/configure-apt-method.sh' -pool: dotestlab +# TODO(jimson): This is a base Ubuntu 1804 Image right now, switch to an image that contains all our dependencies preinstalled +# The advantage to using this over the Microsoft-hosted agent is parallel execution of jobs (infinite # of vms can be spun up at execution time) +pool: 1es_hosted_pool_ubuntu_1804 jobs: - job: Debug steps: - template: templates/dopapt-native-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: debug @@ -53,5 +56,6 @@ jobs: steps: - template: templates/dopapt-native-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: minsizerel \ No newline at end of file diff --git a/azure-pipelines/build/dosdkcpp-docker.yml b/azure-pipelines/build/dosdkcpp-docker.yml index 12f73a8b..9afdf691 100644 --- a/azure-pipelines/build/dosdkcpp-docker.yml +++ b/azure-pipelines/build/dosdkcpp-docker.yml @@ -14,26 +14,28 @@ schedules: include: - main -pool: dotestlab +# TODO(jimson): Provision a 1ES managed image with artifacts that have all our dependencies preinstalled +#pool: 1es_hosted_pool_ubuntu_1804 + +# The microsoft-hosted agents come with docker preinstalled, the caveat being that the bootstrap script needs to be called to provision everything else +pool: + vmImage: 'ubuntu-18.04' jobs: - template: templates/do-docker-jobs.yml parameters: targetOS: 'debian10' targetArch: 'arm32' - dockerImageName: 'jimsonmsft/debian10-arm32:latest' stepsTemplate: 'dosdkcpp-docker-steps.yml' - template: templates/do-docker-jobs.yml parameters: targetOS: 'debian9' targetArch: 'arm32' - dockerImageName: 'jimsonmsft/debian9-arm32:latest' stepsTemplate: 'dosdkcpp-docker-steps.yml' - template: templates/do-docker-jobs.yml parameters: targetOS: 'ubuntu1804' targetArch: 'arm64' - dockerImageName: 'jimsonmsft/ubuntu18.04-arm64:latest' stepsTemplate: 'dosdkcpp-docker-steps.yml' diff --git a/azure-pipelines/build/dosdkcpp-native.yml b/azure-pipelines/build/dosdkcpp-native.yml index 83573ae0..c1d7578b 100644 --- a/azure-pipelines/build/dosdkcpp-native.yml +++ b/azure-pipelines/build/dosdkcpp-native.yml @@ -40,13 +40,16 @@ pr: - azure-pipelines/* - sdk-cpp/build/cleanup-install.sh -pool: dotestlab +# TODO(jimson): This is a base Ubuntu 1804 Image right now, switch to an image that contains all our dependencies preinstalled +# The advantage to using this over the Microsoft-hosted agent is parallel execution of jobs (infinite # of vms can be spun up at execution time) +pool: 1es_hosted_pool_ubuntu_1804 jobs: - job: Debug steps: - template: templates/dosdkcpp-native-steps.yml parameters: + targetOS: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: debug @@ -54,6 +57,7 @@ jobs: steps: - template: templates/dosdkcpp-native-steps.yml parameters: + targetOS: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: minsizerel skipTests: true diff --git a/azure-pipelines/build/templates/do-docker-jobs.yml b/azure-pipelines/build/templates/do-docker-jobs.yml index 61301d14..ddb14cd8 100644 --- a/azure-pipelines/build/templates/do-docker-jobs.yml +++ b/azure-pipelines/build/templates/do-docker-jobs.yml @@ -6,8 +6,6 @@ parameters: type: string - name: targetArch # example: arm32 type: string -- name: dockerImageName # example: jimsonmsft/debian10-arm32:latest - type: string - name: stepsTemplate # example: dopapt-docker-steps.yml type: string @@ -16,14 +14,14 @@ jobs: steps: - template: ${{parameters.stepsTemplate}} parameters: + targetOS: ${{parameters.targetOS}} targetOsArch: ${{parameters.targetOS}}-${{parameters.targetArch}} - dockerImageName: ${{parameters.dockerImageName}} config: debug - job: ${{parameters.targetOS}}_${{parameters.targetArch}}_release steps: - template: ${{parameters.stepsTemplate}} parameters: + targetOS: ${{parameters.targetOS}} targetOsArch: ${{parameters.targetOS}}-${{parameters.targetArch}} - dockerImageName: ${{parameters.dockerImageName}} config: minsizerel diff --git a/azure-pipelines/build/templates/doclient-lite-docker-steps.yml b/azure-pipelines/build/templates/doclient-lite-docker-steps.yml index 2811bf30..73c70295 100644 --- a/azure-pipelines/build/templates/doclient-lite-docker-steps.yml +++ b/azure-pipelines/build/templates/doclient-lite-docker-steps.yml @@ -2,18 +2,46 @@ # Consume this steps template in one or more jobs by passing in parameter values. parameters: -- name: targetOsArch # example: debian10-arm32 +- name: targetOS # example: ubuntu1804 type: string -- name: dockerImageName # example: jimsonmsft/debian10-arm32:latest +- name: targetOsArch # example: ubuntu1804-x64 type: string - name: config # debug/release/minsizerel/relwithdebuginfo type: string steps: +- task: Docker@2 + displayName: Login to ACR + inputs: + command: login + containerRegistry: doclientcontainerregistry + repository: $(parameters.targetOsArch) + +- task: Docker@2 + displayName: Pull latest build image + inputs: + command: pull + containerRegistry: doclientcontainerregistry + arguments: 'doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:latest' + +# TODO(jimson): Once these are onboarded as an artifact to Image Factory, can remove the below two steps as well as the targetOS parameter +# Another alternative is to just do the build from within a docker container, and then run the tests on the host +- task: CmdLine@2 + inputs: + script: 'chmod +x bootstrap.sh' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'chmod bootstrap script' + +- task: CmdLine@2 + inputs: + script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOS}} --install qemu' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Install & register QEMU' + - task: CmdLine@2 inputs: # Unix Makefiles used in place of Ninja due to issues with 32-bit compatability on cross-arch builds - script: 'sudo docker run --rm --entrypoint=python3 -v $(Build.SourcesDirectory):/code -v /tmp/build-deliveryoptimization-agent-${{parameters.targetOsArch}}:/tmp/build-deliveryoptimization-agent ${{parameters.dockerImageName}} "/code/build/build.py" "--clean" "--package-for" "DEB" "--generator" "Unix Makefiles" "--config" "${{parameters.config}}" "--project" "agent"' + script: 'sudo docker run --rm --entrypoint=python3 -v $(Build.SourcesDirectory):/code -v /tmp/build-deliveryoptimization-agent-${{parameters.targetOsArch}}:/tmp/build-deliveryoptimization-agent doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:latest "/code/build/build.py" "--clean" "--package-for" "DEB" "--config" "${{parameters.config}}" "--project" "agent"' displayName: 'Build client-lite ${{parameters.targetOsArch}}-${{parameters.config}}' - task: CopyFiles@2 diff --git a/azure-pipelines/build/templates/doclient-lite-native-steps.yml b/azure-pipelines/build/templates/doclient-lite-native-steps.yml index 2555e8fc..bead0f45 100644 --- a/azure-pipelines/build/templates/doclient-lite-native-steps.yml +++ b/azure-pipelines/build/templates/doclient-lite-native-steps.yml @@ -2,7 +2,9 @@ # Consume this steps template in one or more jobs by passing in parameter values. parameters: -- name: targetOsArch # example: ubuntu18.04-x64 +- name: targetOS # example: ubuntu1804 + type: string +- name: targetOsArch # example: ubuntu1804-x64 type: string - name: config # debug/release type: string @@ -11,12 +13,26 @@ parameters: default: false steps: -# TODO(shishirb) Include --skip-tests build.py option when skipTests is true -- task: PythonScript@0 +# TODO(jimson): Once these are onboarded as an artifact to Image Factory, can remove the below two steps +# Another alternative is to just do the build from within a docker container, and then run the tests on the host +- task: CmdLine@2 + inputs: + script: 'chmod +x bootstrap.sh' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'chmod bootstrap script' + +- task: CmdLine@2 + inputs: + script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOS}}' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Install Dependencies' + +# Have to use cmdline rather than built in python task, because the python env variable chooses python2 +# There is a pipeline task which allows you to specify version, but that requires configuring of the agent tools directory +- task: CmdLine@2 inputs: - scriptSource: 'filePath' - scriptPath: 'build/build.py' - arguments: '--project agent --config ${{parameters.config}} --package-for DEB --clean' + script: 'python3 ./build.py --project agent --config ${{parameters.config}} --package-for DEB --clean' + workingDirectory: '$(Build.SourcesDirectory)/build' displayName: 'Build agent ${{parameters.targetOsArch}}-${{parameters.config}}' - task: Bash@3 diff --git a/azure-pipelines/build/templates/dopapt-docker-steps.yml b/azure-pipelines/build/templates/dopapt-docker-steps.yml index 924946e2..889929bb 100644 --- a/azure-pipelines/build/templates/dopapt-docker-steps.yml +++ b/azure-pipelines/build/templates/dopapt-docker-steps.yml @@ -2,19 +2,52 @@ # Consume this steps template in one or more jobs by passing in parameter values. parameters: -- name: targetOsArch # example: debian10-arm32 +- name: targetOS # example: ubuntu1804 type: string -- name: dockerImageName # example: jimsonmsft/debian10-arm32:latest +- name: targetOsArch # example: ubuntu1804-x64 type: string -- name: config # debug/release +- name: config # debug/release/minsizerel/relwithdebuginfo type: string steps: - checkout: self +# TODO(jimson): Once these are onboarded as an artifact to Image Factory, can remove all dependency install steps - task: CmdLine@2 inputs: - script: 'sudo docker run --rm --entrypoint=/bin/bash -v $(Build.SourcesDirectory):/code -v /tmp/build-deliveryoptimization-plugin-apt-${{parameters.targetOsArch}}:/tmp/build-deliveryoptimization-plugin-apt ${{parameters.dockerImageName}} "/code/build/docker/docker-build-plugin.sh" "/code" "${{parameters.config}}"' + script: 'chmod +x bootstrap.sh' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'chmod bootstrap script' + +- task: CmdLine@2 + inputs: + script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOS}} --install containertools' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Install Docker' + +- task: Docker@2 + displayName: Login to ACR + inputs: + command: login + containerRegistry: doclientcontainerregistry + repository: $(parameters.targetOsArch) + +- task: Docker@2 + displayName: Pull latest build image + inputs: + command: pull + containerRegistry: doclientcontainerregistry + arguments: 'doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:latest' + +- task: CmdLine@2 + inputs: + script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOS}} --install qemu' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Install & register QEMU' + +- task: CmdLine@2 + inputs: + script: 'sudo docker run --rm --entrypoint=/bin/bash -v $(Build.SourcesDirectory):/code -v /tmp/build-deliveryoptimization-plugin-apt-${{parameters.targetOsArch}}:/tmp/build-deliveryoptimization-plugin-apt doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:latest "/code/build/docker/docker-build-plugin.sh" "/code" "${{parameters.config}}"' displayName: 'Build deliveryoptimization-plugin-apt ${{parameters.targetOsArch}}-${{parameters.config}}' - task: CopyFiles@2 diff --git a/azure-pipelines/build/templates/dopapt-native-steps.yml b/azure-pipelines/build/templates/dopapt-native-steps.yml index e4aeb9e6..23e2ab24 100644 --- a/azure-pipelines/build/templates/dopapt-native-steps.yml +++ b/azure-pipelines/build/templates/dopapt-native-steps.yml @@ -2,7 +2,9 @@ # Consume this steps template in one or more jobs by passing in parameter values. parameters: -- name: targetOsArch # example: ubuntu18.04-x64 +- name: targetOS # example: ubuntu1804 + type: string +- name: targetOsArch # example: ubuntu1804-x64 type: string - name: config # debug/release/minsizerel/relwithdebuginfo type: string @@ -10,13 +12,36 @@ parameters: steps: - checkout: self -- task: PythonScript@0 +# TODO(jimson): Once these are onboarded as an artifact to Image Factory, can remove the below two steps +# Another alternative is to just do the build from within a docker container, and then run the tests on the host +- task: CmdLine@2 + inputs: + script: 'chmod +x bootstrap.sh' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'chmod bootstrap script' + +- task: CmdLine@2 inputs: - scriptSource: 'filePath' - scriptPath: 'build/build.py' - arguments: '--project sdk --cmaketarget deliveryoptimization --config ${{parameters.config}} --package-for DEB --clean ' + script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOS}}' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Install Dependencies' + +# Have to use cmdline rather than built in python task, because the python env variable chooses python2 +# There is a pipeline task which allows you to specify version, but that requires configuring of the agent tools directory +- task: CmdLine@2 + inputs: + script: 'python3 ./build.py --project sdk --config ${{parameters.config}} --package-for DEB --clean' + workingDirectory: '$(Build.SourcesDirectory)/build' displayName: 'Build sdk ${{parameters.targetOsArch}}-${{parameters.config}}' +#TODO(jimson): why did this have --cmaketarget flag? +#- task: PythonScript@0 +# inputs: +# scriptSource: 'filePath' +# scriptPath: 'build/build.py' +# arguments: '--project sdk --cmaketarget deliveryoptimization --config ${{parameters.config}} --package-for DEB --clean ' +# displayName: 'Build sdk ${{parameters.targetOsArch}}-${{parameters.config}}' + - task: Bash@3 inputs: targetType: 'inline' @@ -24,13 +49,21 @@ steps: workingDirectory: '/tmp/build-deliveryoptimization-sdk/linux-${{parameters.config}}' displayName: 'Install libdeliveryoptimization' -- task: PythonScript@0 +# Have to use cmdline rather than built in python task, because the python env variable chooses python2 +# There is a pipeline task which allows you to specify version, but that requires configuring of the agent tools directory +- task: CmdLine@2 inputs: - scriptSource: 'filePath' - scriptPath: 'build/build.py' - arguments: '--project plugin-apt --config ${{parameters.config}} --package-for DEB --clean' + script: 'python3 ./build.py --project plugin-apt --config ${{parameters.config}} --package-for DEB --clean' + workingDirectory: '$(Build.SourcesDirectory)/build' displayName: 'Build deliveryoptimization-plugin-apt ${{parameters.targetOsArch}}-${{parameters.config}}' +#- task: PythonScript@0 +# inputs: +# scriptSource: 'filePath' +# scriptPath: 'build/build.py' +# arguments: '--project plugin-apt --config ${{parameters.config}} --package-for DEB --clean' +# displayName: 'Build deliveryoptimization-plugin-apt ${{parameters.targetOsArch}}-${{parameters.config}}' + - task: Bash@3 condition: eq('${{parameters.config}}', 'minsizerel') inputs: diff --git a/azure-pipelines/build/templates/dosdkcpp-docker-steps.yml b/azure-pipelines/build/templates/dosdkcpp-docker-steps.yml index 621ce84d..6b25d16b 100644 --- a/azure-pipelines/build/templates/dosdkcpp-docker-steps.yml +++ b/azure-pipelines/build/templates/dosdkcpp-docker-steps.yml @@ -2,18 +2,47 @@ # Consume this steps template in one or more jobs by passing in parameter values. parameters: -- name: targetOsArch # example: debian10-arm32 +- name: targetOS # example: ubuntu18.04 type: string -- name: dockerImageName # example: jimsonmsft/debian10-arm32:latest +- name: targetOsArch # example: ubuntu18.04-x64 type: string - name: config # debug/release type: string steps: +# TODO(jimson): Once these are onboarded as an artifact to Image Factory, can remove all dependency install steps +- task: Docker@2 + displayName: Login to ACR + inputs: + command: login + containerRegistry: doclientcontainerregistry + repository: $(parameters.targetOsArch) + +- task: Docker@2 + displayName: Pull latest build image + inputs: + command: pull + containerRegistry: doclientcontainerregistry + arguments: 'doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:latest' + +# TODO(jimson): Once these are onboarded as an artifact to Image Factory, can remove the below two steps as well as the targetOS parameter +# Another alternative is to just do the build from within a docker container, and then run the tests on the host +- task: CmdLine@2 + inputs: + script: 'chmod +x bootstrap.sh' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'chmod bootstrap script' + +- task: CmdLine@2 + inputs: + script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOS}} --install qemu' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Install & register QEMU' + - task: CmdLine@2 inputs: # Unix Makefiles used in place of Ninja due to issues with 32-bit compatability on cross-arch builds - script: 'sudo docker run --rm --entrypoint=python3 -v $(Build.SourcesDirectory):/code -v /tmp/build-deliveryoptimization-sdk-${{parameters.targetOsArch}}:/tmp/build-deliveryoptimization-sdk ${{parameters.dockerImageName}} "/code/build/build.py" "--clean" "--package-for" "DEB" "--generator" "Unix Makefiles" "--config" "${{parameters.config}}" "--project" "sdk" "--cmaketarget" "deliveryoptimization"' + script: 'sudo docker run --rm --entrypoint=python3 -v $(Build.SourcesDirectory):/code -v /tmp/build-deliveryoptimization-sdk-${{parameters.targetOsArch}}:/tmp/build-deliveryoptimization-sdk doclientcontainerregistry.azurecr.io/${{parameters.targetOsArch}}:latest "/code/build/build.py" "--clean" "--package-for" "DEB" "--generator" "Unix Makefiles" "--config" "${{parameters.config}}" "--project" "sdk" "--cmaketarget" "deliveryoptimization"' displayName: 'Build sdk-cpp ${{parameters.targetOsArch}}-${{parameters.config}}' - task: CopyFiles@2 diff --git a/azure-pipelines/build/templates/dosdkcpp-native-steps.yml b/azure-pipelines/build/templates/dosdkcpp-native-steps.yml index 33de0f13..c0d586c3 100644 --- a/azure-pipelines/build/templates/dosdkcpp-native-steps.yml +++ b/azure-pipelines/build/templates/dosdkcpp-native-steps.yml @@ -2,7 +2,9 @@ # Consume this steps template in one or more jobs by passing in parameter values. parameters: -- name: targetOsArch # example: ubuntu18.04-x64 +- name: targetOS # example: ubuntu1804 + type: string +- name: targetOsArch # example: ubuntu1804-x64 type: string - name: config # debug/release/minsizerel/relwithdebuginfo type: string @@ -11,13 +13,27 @@ parameters: default: false steps: +# TODO(jimson): Once these are onboarded as an artifact to Image Factory, can remove the below two steps +# Another alternative is to just do the build from within a docker container, and then run the tests on the host +- task: CmdLine@2 + inputs: + script: 'chmod +x bootstrap.sh' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'chmod bootstrap script' + +- task: CmdLine@2 + inputs: + script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOs}}' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Install Dependencies' + +# Have to use cmdline rather than built in python task, because the python env variable chooses python2 +# There is a pipeline task which allows you to specify version, but that requires configuring of the agent tools directory # TODO(shishirb) Include --skip-tests build.py option when skipTests is true -- task: PythonScript@0 - condition: eq('${{parameters.skipTests}}', false) +- task: CmdLine@2 inputs: - scriptSource: 'filePath' - scriptPath: 'build/build.py' - arguments: '--project agent --cmaketarget deliveryoptimization-agent --config ${{parameters.config}} --package-for DEB --clean' + script: 'python3 ./build.py --project agent --cmaketarget deliveryoptimization-agent --config ${{parameters.config}} --package-for DEB --clean' + workingDirectory: '$(Build.SourcesDirectory)/build' displayName: 'Build agent ${{parameters.targetOsArch}}-${{parameters.config}}' - task: CmdLine@2 @@ -27,12 +43,11 @@ steps: workingDirectory: '/tmp/build-deliveryoptimization-agent/linux-${{parameters.config}}' displayName: 'Install agent Debian package' -- task: PythonScript@0 +- task: CmdLine@2 inputs: - scriptSource: 'filePath' - scriptPath: 'build/build.py' - arguments: '--project sdk --cmaketarget deliveryoptimization --config ${{parameters.config}} --package-for DEB --clean' - displayName: 'Build sdk-cpp ${{parameters.targetOsArch}}-${{parameters.config}}' + script: 'python3 ./build.py --project sdk --cmaketarget deliveryoptimization --config ${{parameters.config}} --package-for DEB --clean' + workingDirectory: '$(Build.SourcesDirectory)/build' + displayName: 'Build sdk ${{parameters.targetOsArch}}-${{parameters.config}}' - task: Bash@3 condition: eq('${{parameters.config}}', 'minsizerel') @@ -49,12 +64,10 @@ steps: workingDirectory: '/tmp/build-deliveryoptimization-sdk/linux-${{parameters.config}}' displayName: 'Install libdeliveryoptimization Debian Package' -- task: PythonScript@0 - condition: eq('${{parameters.skipTests}}', false) +- task: CmdLine@2 inputs: - scriptSource: 'filePath' - scriptPath: 'build/build.py' - arguments: '--project sdk --cmaketarget deliveryoptimization-sdk-tests --config ${{parameters.config}}' + script: 'python3 ./build.py --project sdk --cmaketarget deliveryoptimization-sdk-tests --config ${{parameters.config}}' + workingDirectory: '$(Build.SourcesDirectory)/build' displayName: 'Build sdk-cpp tests ${{parameters.targetOsArch}}-${{parameters.config}}' # Run all tests. These must run as root because docs is running as the 'do' user diff --git a/azure-pipelines/publishing/github-release.yml b/azure-pipelines/publishing/github-release.yml index ad2c2e83..e9932a93 100644 --- a/azure-pipelines/publishing/github-release.yml +++ b/azure-pipelines/publishing/github-release.yml @@ -6,7 +6,7 @@ trigger: pr: - none -pool: dotestlab +pool: 1es_hosted_pool_ubuntu_1804 variables: Release.Version: $(release_version) @@ -28,6 +28,7 @@ stages: steps: - template: ../build/templates/doclient-lite-native-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: release skipTests: true @@ -35,28 +36,29 @@ stages: steps: - template: ../build/templates/doclient-lite-docker-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: ubuntu1804-arm64 - dockerImageName: 'jimsonmsft/ubuntu18.04-arm64:latest' config: release - job: deliveryoptimization_agent_debian10_arm32 steps: - template: ../build/templates/doclient-lite-docker-steps.yml parameters: + targetOs: 'debian10' targetOsArch: debian10-arm32 - dockerImageName: 'jimsonmsft/debian10-arm32:latest' config: release - job: deliveryoptimization_agent_debian9_arm32 steps: - template: ../build/templates/doclient-lite-docker-steps.yml parameters: + targetOs: 'debian9' targetOsArch: debian9-arm32 - dockerImageName: 'jimsonmsft/debian9-arm32:latest' config: release - job: libdeliveryoptimization_ubuntu1804_amd64 steps: - template: ../build/templates/dosdkcpp-native-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: release skipTests: true @@ -64,50 +66,51 @@ stages: steps: - template: ../build/templates/dosdkcpp-docker-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: ubuntu1804-arm64 - dockerImageName: 'jimsonmsft/ubuntu18.04-arm64:latest' config: release - job: libdeliveryoptimization_debian10_arm32 steps: - template: ../build/templates/dosdkcpp-docker-steps.yml parameters: + targetOs: 'debian10' targetOsArch: debian10-arm32 - dockerImageName: 'jimsonmsft/debian10-arm32:latest' config: release - job: libdeliveryoptimization_debian9_arm32 steps: - template: ../build/templates/dosdkcpp-docker-steps.yml parameters: + targetOs: 'debian9' targetOsArch: debian9-arm32 - dockerImageName: 'jimsonmsft/debian9-arm32:latest' config: release - job: deliveryoptimization_plugin_apt_ubuntu1804_amd64 steps: - template: ../build/templates/dopapt-native-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: 'ubuntu1804-x64' config: release - job: deliveryoptimization_plugin_apt_ubuntu1804_arm64 steps: - template: ../build/templates/dopapt-docker-steps.yml parameters: + targetOs: 'ubuntu1804' targetOsArch: ubuntu1804-arm64 - dockerImageName: 'jimsonmsft/ubuntu18.04-arm64:latest' config: release - job: deliveryoptimization_plugin_apt_debian10_arm32 steps: - template: ../build/templates/dopapt-docker-steps.yml parameters: + targetOs: 'debian10' targetOsArch: debian10-arm32 - dockerImageName: 'jimsonmsft/debian10-arm32:latest' config: release - job: deliveryoptimization_plugin_apt_debian9_arm32 steps: - template: ../build/templates/dopapt-docker-steps.yml parameters: + targetOs: 'debian9' targetOsArch: debian9-arm32 - dockerImageName: 'jimsonmsft/debian9-arm32:latest' config: release - stage: release diff --git a/build/bootstrap.sh b/build/bootstrap.sh new file mode 100644 index 00000000..75276a59 --- /dev/null +++ b/build/bootstrap.sh @@ -0,0 +1,240 @@ +#! /bin/bash + +# bootstrap scripts will exit immediately if a command exits with a non-zero status +set -e + +# Defaults +INSTALL=all + +usage() { + cat < --install + --platform # Platform to provision, supported platforms: Ubuntu1804, Ubuntu 2004, Debian9, Debian 10. Default is Ubuntu1804 + --install # Which command to run, supported commands: builddependencies, developertools, containertools, qemu, all. Default is All +EOM + exit 1 +} + +function parseArgs() { + arg_Positional=() + while [[ $# -gt 0 ]]; do + case $1 in + --help | -h) + usage + shift + exit 0 + ;; + --platform | -p) + PLATFORM="${2,,}" + if [[ "$PLATFORM" == "debian9" || "$PLATFORM" == "debian10" || "$PLATFORM" == "ubuntu1804" || "$PLATFORM" == "ubuntu2004" ]]; + then + echo -e "[INFO] Platform set to: ${PLATFORM}" + else + echo -e "[ERROR] Unsupported platform: ${PLATFORM}" + exit + fi + + shift + ;; + --install | -i) + INSTALL="${2,,}" + echo -e "[INFO] Install command to run set to: ${INSTALL}" + shift + ;; + *) + arg_Positional+=("$1") + shift + ;; + esac + done +} + +function installBuildDependencies +{ + if [[ -v PLATFORM ]] + then + echo "[INFO] Platform check succesful" + else + echo "[WARNING] No platform supplied, using default: Ubuntu1804" + PLATFORM = "ubuntu1804" + fi + + echo "[INFO] Installing build dependencies" + apt-get install -y make build-essential g++ gdb gdbserver gcc git wget + apt-get install -y python3 ninja-build + + if [[ "$PLATFORM" == "debian9" ]]; + then + # Cpprestsdk below requires min cmake version of 3.9, while 3.7 is the latest available on Debian9 + # So build & install cmake from source + cd /tmp + wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz + tar xzf cmake-3.10.2.tar.gz + cd /tmp/cmake-3.10.2 + ./bootstrap + make + make install + + # Install gsl from source, also not available on Debian9 + cd /tmp/ + git clone https://github.com/Microsoft/GSL.git + cd GSL/ + git checkout tags/v2.0.0 + cmake -DGSL_TEST=OFF . + make + make install + else + apt-get -y install cmake libmsgsl-dev + fi + + # Open-source library dependencies + # Boost libs for DO + apt-get install -y libboost-system-dev libboost-log-dev libboost-filesystem-dev libboost-program-options-dev + # Additional Boost libs for cpprestsdk + apt-get install -y libboost-random-dev libboost-regex-dev + apt-get install -y libproxy-dev libssl-dev uuid-dev + + # Install cpprest dependencies + # libssl-dev also required but installed above because plugin uses libssl-dev directly + apt-get install -y zlib1g-dev + + # Most target platforms do not natively have a version of cpprest that supports url-redirection + # Build and install v2.10.16 as it's the earliest version which supports url-redirection + mkdir /tmp/cpprestsdk + cd /tmp/cpprestsdk + git clone https://github.com/microsoft/cpprestsdk.git . + git checkout tags/v2.10.16 + git submodule update --init + mkdir /tmp/cpprestsdk/build + cd /tmp/cpprestsdk/build + cmake -G Ninja -DCMAKE_BUILD_TYPE=minsizerel -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -Wno-dev -DWERROR=OFF .. + ninja + ninja install + + if [[ "$PLATFORM" == "ubuntu2004" || "$PLATFORM" == "debian10" ]]; + then + # The latest native-version of gtest on ubuntu2004 and debian10 currently has a bug where CMakeLists doesn't declare an install target, causing 'make install' to fail + # Clone from source and use release-1.10.0 instead, since gtest is a source package anyways + mkdir /tmp/gtest + cd /tmp/gtest + git clone https://github.com/google/googletest.git . + git checkout release-1.10.0 + mkdir cmake + cd cmake + cmake /tmp/gtest + make + make install + else + # libgtest-dev is a source package and requires manual installation + apt-get -y install libgtest-dev + mkdir /tmp/build_gtest/ + cd /tmp/build_gtest + cmake /usr/src/gtest + make + make install + fi +} + +function installDeveloperTools +{ + echo "[INFO] Installing developer tools" + apt install -y python-pip + pip install cpplint + + # Installs to a non-standard location so add to PATH manually + export PATH=$PATH:~/.local/bin +} + +#TODO(jimson): If this script isn't working for provisioning docker on an image, consider using someone elses docker script (from ImageFactory artifacts) +function installContainerTools +{ + apt-get install -y curl + + echo "[INFO] Installing Docker" + # Install docker to enable building cross-arch for arm + # Instructions located at: https://docs.docker.com/engine/install/ubuntu/ + curl -fsSL https://get.docker.com -o get-docker.sh + sh get-docker.sh + + # Allow docker to run without sudo + #usermod -aG docker $USER + #newgrp docker + + # ---- lowered permissions install below + + #apt-get install -y uidmap + + #apt-get install -y \ + #apt-transport-https \ + #ca-certificates \ + #curl \ + #gnupg \ + #lsb-release + + #curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + + #echo \ + # "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ + # $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + + #apt-get update -y + #apt-get install -y docker-ce docker-ce-cli containerd.io + + #apt-get install -y docker-ce-rootless-extras + + # This cannot be run as sudo + ##/usr/bin/dockerd-rootless-setuptool.sh install +} + +function installQemu +{ + echo "[INFO] Installing Qemu for cross-arch support" + # Install qemu for cross-arch support + apt-get -y install qemu binfmt-support qemu-user-static + + # Register qemu with docker to more easily run cross-arch containers + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +} + +function installAll +{ + echo "Setting up development environment for do-client" + installBuildDependencies + installDeveloperTools + installContainerTools + installQemu +} + +main() +{ + parseArgs "$@" + + + echo "[INFO] Updating package manager" + apt-get update -y --fix-missing + + echo "[INFO] Running install command: $INSTALL" + case $INSTALL in + all) + installAll + ;; + build) + installBuildDependencies + ;; + developertools) + installDeveloperTools + ;; + containertools) + installContainerTools + ;; + qemu) + installQemu + ;; + esac + + echo "[INFO] Finished bootstrapping" +} + +main "$@" + diff --git a/build/bootstrap/bootstrap-debian-10.sh b/build/bootstrap/bootstrap-debian-10.sh deleted file mode 100644 index 7df01edc..00000000 --- a/build/bootstrap/bootstrap-debian-10.sh +++ /dev/null @@ -1,49 +0,0 @@ -#! /bin/bash - -# bootstrap scripts will exit immediately if a command exits with a non-zero status -set -e - -echo "Setting up development environment for do-client" - -# Various development machine tools -apt-get update -y --fix-missing -apt-get install -y make build-essential g++ gdb gdbserver gcc git wget -apt-get install -y python3 cmake ninja-build - -# Open-source library dependencies -# Boost libs for DO -apt-get install -y libboost-system-dev libboost-log-dev libboost-filesystem-dev libboost-program-options-dev -# Additional Boost libs for cpprestsdk -apt-get install -y libboost-random-dev libboost-regex-dev -apt-get install -y libgtest-dev libproxy-dev libmsgsl-dev libssl-dev uuid-dev - -# Install cpprest dependencies -# libssl-dev also required but installed above because plugin uses libssl-dev directly -apt-get install -y zlib1g-dev - -# Cpprestsdk 2.10.10 is the latest publicly available version on Debian 10 -# Build and install v2.10.16 as it's the earliest version which supports url-redirection -mkdir /tmp/cpprestsdk -cd /tmp/cpprestsdk -git clone https://github.com/microsoft/cpprestsdk.git . -git checkout v2.10.16 -git submodule update --init -mkdir /tmp/cpprestsdk/build -cd /tmp/cpprestsdk/build -cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -Wno-dev -DWERROR=OFF .. -ninja -ninja install - -# The latest native-version of gtest on debian10 currently has a bug where CMakeLists doesn't declare an install target, causing 'make install' to fail -# Clone from source and use release-1.10.0 instead, since gtest is a source package anyways -mkdir /tmp/gtest -cd /tmp/gtest -git clone https://github.com/google/googletest.git . -git checkout release-1.10.0 -mkdir cmake -cd cmake -cmake /tmp/gtest -make -make install - -echo "Finished bootstrapping" \ No newline at end of file diff --git a/build/bootstrap/bootstrap-debian-9.sh b/build/bootstrap/bootstrap-debian-9.sh deleted file mode 100644 index 5185482b..00000000 --- a/build/bootstrap/bootstrap-debian-9.sh +++ /dev/null @@ -1,64 +0,0 @@ -#! /bin/bash - -# bootstrap scripts will exit immediately if a command exits with a non-zero status -set -e - -echo "Setting up development environment for do-client" - -# Various development machine tools -apt-get update -y --fix-missing -apt-get install -y make build-essential g++ gdb gdbserver gcc git wget - -# Cpprestsdk below requires min cmake version of 3.9, while 3.7 is the latest available on Debian9 -# So build & install cmake from source -cd /tmp -wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz -tar xzf cmake-3.10.2.tar.gz -cd /tmp/cmake-3.10.2 -./bootstrap -make -make install - -apt-get install -y python3 ninja-build - -# Open-source library dependencies -# Boost libs for DO -apt-get install -y libboost-system-dev libboost-log-dev libboost-filesystem-dev libboost-program-options-dev -# Additional Boost libs for cpprestsdk -apt-get install -y libboost-random-dev libboost-regex-dev -apt-get install -y libcpprest-dev libgtest-dev libproxy-dev libssl-dev uuid-dev - -# Install cpprest dependencies -# libssl-dev also required but installed above because plugin uses libssl-dev directly -apt-get install -y zlib1g-dev - -# Cpprestsdk 2.9.1 is the latest publicly available version on Debian 9 -# Build and install v2.10.16 as it's the earliest version which supports url-redirection -mkdir /tmp/cpprestsdk -cd /tmp/cpprestsdk -git clone https://github.com/microsoft/cpprestsdk.git . -git checkout v2.10.16 -git submodule update --init -mkdir /tmp/cpprestsdk/build -cd /tmp/cpprestsdk/build -cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -Wno-dev -DWERROR=OFF .. -ninja -ninja install - -# libgtest-dev is a source package and requires manual installation -mkdir /tmp/build_gtest/ -cd /tmp/build_gtest -cmake /usr/src/gtest -make -make install - -# Install gsl from source (not present in debian stretch packages) -cd /tmp/ -git clone https://github.com/Microsoft/GSL.git -cd GSL/ -git checkout tags/v2.0.0 -cmake -DGSL_TEST=OFF . -make -make install - -echo "Finished bootstrapping" \ No newline at end of file diff --git a/build/bootstrap/bootstrap-ubuntu-18.04.sh b/build/bootstrap/bootstrap-ubuntu-18.04.sh deleted file mode 100644 index fad876b6..00000000 --- a/build/bootstrap/bootstrap-ubuntu-18.04.sh +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/bash - -# bootstrap scripts will exit immediately if a command exits with a non-zero status -set -e - -echo "Setting up development environment for do-client" - -# Various development machine tools -apt-get update -apt-get install -y build-essential g++ gdb gdbserver git wget -apt-get install -y python3 cmake ninja-build rpm - -# Open-source library dependencies -# Boost libs for DO -apt-get install -y libboost-system-dev libboost-log-dev libboost-filesystem-dev libboost-program-options-dev -# Additional Boost libs for cpprestsdk -apt-get install -y libboost-random-dev libboost-regex-dev -apt-get install -y libgtest-dev libproxy-dev libmsgsl-dev libssl-dev uuid-dev - -# Install cpprest dependencies -# libssl-dev also required but installed above because plugin uses libssl-dev directly -apt-get install -y zlib1g-dev - -# Cpprestsdk 2.10.2 is the latest publicly available version on Ubuntu 18.04 -# Build and install v2.10.16 as it's the earliest version which supports url-redirection -mkdir /tmp/cpprestsdk -cd /tmp/cpprestsdk -git clone https://github.com/microsoft/cpprestsdk.git . -git checkout tags/v2.10.16 -git submodule update --init -mkdir /tmp/cpprestsdk/build -cd /tmp/cpprestsdk/build -cmake -G Ninja -DCMAKE_BUILD_TYPE=minsizerel -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -Wno-dev -DWERROR=OFF .. -ninja -ninja install - -# libgtest-dev is a source package and requires manual installation -mkdir /tmp/build_gtest/ -cd /tmp/build_gtest -cmake /usr/src/gtest -make -make install - -if [[ "$1" == "--no-tools" ]]; then - echo "Skipping tools install" -else - apt install -y python-pip - pip install cpplint - # Installs to a non-standard location so add to PATH manually - export PATH=$PATH:~/.local/bin - - # Install docker to enable building cross-arch for arm - # Instructions located at: https://docs.docker.com/engine/install/ubuntu/ - curl -fsSL https://get.docker.com -o get-docker.sh - sh get-docker.sh - # Install qemu for cross-arch support - apt-get -y install qemu binfmt-support qemu-user-static - - # Register qemu with docker to more easily run cross-arch containers - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -fi - -echo "Finished bootstrapping" diff --git a/build/bootstrap/bootstrap-ubuntu-20.04.sh b/build/bootstrap/bootstrap-ubuntu-20.04.sh deleted file mode 100644 index b913b024..00000000 --- a/build/bootstrap/bootstrap-ubuntu-20.04.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /bin/bash - -# bootstrap scripts will exit immediately if a command exits with a non-zero status -set -e - -echo "Setting up development environment for do-client" - -# Various development machine tools -apt-get update -apt-get install -y build-essential g++ gdb gdbserver git wget -apt-get install -y python3 cmake ninja-build rpm - -# Open-source library dependencies -# Boost libs for DO -apt-get install -y libboost-system-dev libboost-log-dev libboost-filesystem-dev libboost-program-options-dev -# Additional Boost libs for cpprestsdk -apt-get install -y libboost-random-dev libboost-regex-dev -apt-get install -y libgtest-dev libproxy-dev libmsgsl-dev libssl-dev uuid-dev - -# Install cpprest dependencies -# libssl-dev also required but installed above because plugin uses libssl-dev directly -apt-get install -y zlib1g-dev - -# Cpprestsdk 2.10.15 is the latest publicly available version on Ubuntu 20.04 -# Build and install v2.10.16 as it's the earliest version which supports url-redirection -mkdir /tmp/cpprestsdk -cd /tmp/cpprestsdk -git clone https://github.com/microsoft/cpprestsdk.git . -git checkout tags/v2.10.16 -git submodule update --init -mkdir /tmp/cpprestsdk/build -cd /tmp/cpprestsdk/build -cmake -G Ninja -DCMAKE_BUILD_TYPE=minsizerel -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -Wno-dev -DWERROR=OFF .. -ninja -ninja install - -# The latest native-version of gtest on Ubuntu20.04 currently has a bug where CMakeLists doesn't declare an install target, causing 'make install' to fail -# Clone from source and use release-1.10.0 instead, since gtest is a source package anyways -mkdir /tmp/gtest -cd /tmp/gtest -git clone https://github.com/google/googletest.git . -git checkout release-1.10.0 -mkdir cmake -cd cmake -cmake /tmp/gtest -make -make install - -if [[ "$1" == "--no-tools" ]]; then - echo "Skipping tools install" -else - apt install -y python-pip - pip install cpplint - # Installs to a non-standard location so add to PATH manually - export PATH=$PATH:~/.local/bin - - # Install docker to enable building cross-arch for arm - # Instructions located at: https://docs.docker.com/engine/install/ubuntu/ - curl -fsSL https://get.docker.com -o get-docker.sh - sh get-docker.sh - # Install qemu for cross-arch support - apt-get -y install qemu binfmt-support qemu-user-static - - # Register qemu with docker to more easily run cross-arch containers - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -fi - -echo "Finished bootstrapping" diff --git a/build/docker/arm32/debian10/Dockerfile b/build/docker/debian10/arm32/Dockerfile similarity index 83% rename from build/docker/arm32/debian10/Dockerfile rename to build/docker/debian10/arm32/Dockerfile index bd2909fa..e49431c0 100644 --- a/build/docker/arm32/debian10/Dockerfile +++ b/build/docker/debian10/arm32/Dockerfile @@ -17,25 +17,25 @@ SHELL [ "/bin/bash", "-c"] # sudo apt-get install qemu-user # update-binfmts --display # sudo apt install qemu binfmt-support qemu-user-static -# cp /usr/bin/qemu-arm-static /build/docker/arm32/debian10 +# cp /usr/bin/qemu-arm-static /build/docker/debian10/arm32 # # Then copy the build script to the build directory -# cp /build/bootstrap/bootstrap-debian-10.sh build/docker/arm32/debian10 +# cp /build/bootstrap.sh /build/docker/debian10/arm32 # # After running the above, you can build the image by running in the current dockerfile directory # sudo docker build -t . --no-cache --network=host COPY qemu-arm-static /usr/bin/qemu-arm-static -COPY bootstrap-debian-10.sh /tmp/bootstrap-debian-10.sh +COPY bootstrap.sh /tmp/bootstrap.sh WORKDIR /tmp/ -RUN chmod +x bootstrap-debian-10.sh -RUN ./bootstrap-debian-10.sh +RUN chmod +x bootstrap.sh +RUN ./bootstrap.sh --platform debian10 --install build VOLUME /code WORKDIR /code -ENTRYPOINT [ "/bin/bash", "-c" ] +ENTRYPOINT [ "/bin/bash", "-c"] # We specify an empty command so that we can pass options to the ENTRYPOINT command. # This is a bit of a Dockerfile quirk where if the ENTRYPOINT value is defined, diff --git a/build/docker/arm32/debian9/Dockerfile b/build/docker/debian9/arm32/Dockerfile similarity index 85% rename from build/docker/arm32/debian9/Dockerfile rename to build/docker/debian9/arm32/Dockerfile index 04d98b8d..1787628b 100644 --- a/build/docker/arm32/debian9/Dockerfile +++ b/build/docker/debian9/arm32/Dockerfile @@ -17,20 +17,20 @@ SHELL [ "/bin/bash", "-c"] # sudo apt-get install qemu-user # update-binfmts --display # sudo apt install qemu binfmt-support qemu-user-static -# cp /usr/bin/qemu-arm-static /build/docker/arm32/debian9 +# cp /usr/bin/qemu-arm-static /build/docker/debian9/arm32 # # Then copy the build script to the build directory -# cp /build/bootstrap/bootstrap-debian-9.sh build/docker/arm32/debian9 +# cp /build/bootstrap.sh build/docker/debian9/arm32 # # After running the above, you can build the image by running in the current dockerfile directory # sudo docker build -t . --no-cache --network=host COPY qemu-arm-static /usr/bin/qemu-arm-static -COPY bootstrap-debian-9.sh /tmp/bootstrap-debian-9.sh +COPY bootstrap.sh /tmp/bootstrap.sh WORKDIR /tmp/ -RUN chmod +x bootstrap-debian-9.sh -RUN ./bootstrap-debian-9.sh +RUN chmod +x bootstrap.sh +RUN ./bootstrap.sh --platform debian9 --install build VOLUME /code WORKDIR /code diff --git a/build/docker/arm64/Ubuntu18.04/Dockerfile b/build/docker/ubuntu1804/arm64/Dockerfile similarity index 82% rename from build/docker/arm64/Ubuntu18.04/Dockerfile rename to build/docker/ubuntu1804/arm64/Dockerfile index ed79203d..08f13b18 100644 --- a/build/docker/arm64/Ubuntu18.04/Dockerfile +++ b/build/docker/ubuntu1804/arm64/Dockerfile @@ -5,7 +5,7 @@ # Open interactive terminal into the image in a container: # docker run -ti --rm --entrypoint=/bin/bash -v :/code -v :/build # Example: -# docker run -ti --rm --entrypoint=/bin/bash -v D:\do-client-lite:/code -v D:\temp\build_client_lite\arm-linux-debug:/build custom-ubuntu18.04-arm64 +# docker run -ti --rm --entrypoint=/bin/bash -v D:\do-client-lite:/code -v D:\temp\build_client_lite\arm-linux-debug:/build custom-ubuntu1804-arm64 FROM arm64v8/ubuntu:18.04 @@ -17,20 +17,23 @@ SHELL [ "/bin/bash", "-c"] # sudo apt-get install qemu-user # update-binfmts --display # sudo apt install qemu binfmt-support qemu-user-static -# cp /usr/bin/qemu-aarch64-static /build/docker/arm64/ubuntu18.04 +# cp /usr/bin/qemu-aarch64-static /build/docker/ubuntu1804/arm64 # # Then copy the build script to the build directory -# cp /build/bootstrap/bootstrap-ubuntu-18.04.sh build/docker/arm64/ubuntu18.04 +# cp /build/bootstrap.sh build/docker/ubuntu1804/arm64 # # After running the above, you can build the image by running in the current dockerfile directory # sudo docker build -t . --no-cache --network=host COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static -COPY bootstrap-ubuntu-18.04.sh /tmp/bootstrap-ubuntu-18.04.sh +COPY bootstrap.sh /tmp/bootstrap.sh WORKDIR /tmp/ -RUN chmod +x bootstrap-ubuntu-18.04.sh -RUN ./bootstrap-ubuntu-18.04.sh --no-tools +RUN chmod +x bootstrap.sh +RUN ./bootstrap.sh --platform ubuntu1804 --install build + +VOLUME /code +WORKDIR /code ENTRYPOINT [ "/bin/bash", "-c"] diff --git a/build/docker/arm64/Ubuntu20.04/Dockerfile b/build/docker/ubuntu2004/arm64/Dockerfile similarity index 83% rename from build/docker/arm64/Ubuntu20.04/Dockerfile rename to build/docker/ubuntu2004/arm64/Dockerfile index e3013c17..25ca35d4 100644 --- a/build/docker/arm64/Ubuntu20.04/Dockerfile +++ b/build/docker/ubuntu2004/arm64/Dockerfile @@ -5,7 +5,7 @@ # Open interactive terminal into the image in a container: # docker run -ti --rm --entrypoint=/bin/bash -v :/code -v :/build # Example: -# docker run -ti --rm --entrypoint=/bin/bash -v D:\do-client-lite:/code -v D:\temp\build_client_lite\arm-linux-debug:/build custom-ubuntu20.04-arm64 +# docker run -ti --rm --entrypoint=/bin/bash -v D:\do-client-lite:/code -v D:\temp\build_client_lite\arm-linux-debug:/build custom-ubuntu2004-arm64 FROM arm64v8/ubuntu:20.04 @@ -17,10 +17,10 @@ SHELL [ "/bin/bash", "-c"] # sudo apt-get install qemu-user # update-binfmts --display # sudo apt install qemu binfmt-support qemu-user-static -# cp /usr/bin/qemu-aarch64-static /build/docker/arm64/ubuntu20.04 +# cp /usr/bin/qemu-aarch64-static /build/docker/ubuntu2004/arm64 # # Then copy the build script to the build directory -# cp /build/bootstrap/bootstrap-ubuntu-20.04.sh build/docker/arm64/ubuntu20.04 +# cp /build/bootstrap.sh build/docker/ubuntu2004/arm64 # # After running the above, you can build the image by running in the current dockerfile directory # sudo docker build -t . --no-cache --network=host @@ -29,11 +29,14 @@ SHELL [ "/bin/bash", "-c"] ENV DEBIAN_FRONTEND=noninteractive COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static -COPY bootstrap-ubuntu-20.04.sh /tmp/bootstrap-ubuntu-20.04.sh +COPY bootstrap.sh /tmp/bootstrap.sh WORKDIR /tmp/ -RUN chmod +x bootstrap-ubuntu-20.04.sh -RUN ./bootstrap-ubuntu-20.04.sh --no-tools +RUN chmod +x bootstrap.sh +RUN ./bootstrap.sh --platform ubuntu2004 --install build + +VOLUME /code +WORKDIR /code ENTRYPOINT [ "/bin/bash", "-c"]