AzDO Migration - Move off self-hosted pools, build script improvements, naming cleanups #47
Conversation
Migrate to using hosted agents/1es hosted pool Modify bootstrap script Various cleanup around paths and naming conventions
| @@ -0,0 +1,220 @@ | |||
| #! /bin/bash | |||
There was a problem hiding this comment.
Part of the motivation behind this script change is to be able to invoke it as an image factory artifact to help us provision our dependencies when constructing a managed image #Closed
|
|
||
| parameters: | ||
| - name: targetOsArch # example: debian10-arm32 | ||
| - name: targetOS # example: ubuntu18.04 |
| - none | ||
|
|
||
| pool: dotestlab | ||
| pool: 1es_hosted_pool_ubuntu_1804 |
There was a problem hiding this comment.
This should actually be using the msft hosted agent, until 1ES machine can support docker #Resolved
build/bootstrap.sh
Outdated
| # This script handles provisioning of the Delivery Optimization client components on supported platforms | ||
| ### | ||
|
|
||
| # bootstrap scripts will exit immediately if a command exits with a non-zero status |
There was a problem hiding this comment.
can remove this comment #Closed
There was a problem hiding this comment.
Maybe keep it and shorten it to 'Treat all command failures as fatal'
| WORKDIR /code | ||
|
|
||
| ENTRYPOINT [ "/bin/bash", "-c" ] | ||
| ENTRYPOINT [ "/bin/bash", "-c"] |
build/bootstrap.sh
Outdated
| cat <<EOM | ||
| $(basename $0) - Script to setup development environments for Delivery Optimization | ||
| Usage: $(basename $0) --platform <platform to install for> --install <install command> | ||
| --platform # Platform to provision, supported platforms: Ubuntu1804, Ubuntu 2004, Debian9, Debian 10. Default is Ubuntu1804 |
build/bootstrap.sh
Outdated
| exit 1 | ||
| } | ||
|
|
||
| function parseArgs() { |
build/bootstrap.sh
Outdated
| echo -e "[INFO] Platform set to: ${PLATFORM}" | ||
| else | ||
| echo -e "[ERROR] Unsupported platform: ${PLATFORM}" | ||
| exit |
build/bootstrap.sh
Outdated
| cat <<EOM | ||
| $(basename $0) - Script to setup development environments for Delivery Optimization | ||
| Usage: $(basename $0) --platform <platform to install for> --install <install command> | ||
| --platform # Platform to provision, supported platforms: Ubuntu1804, Ubuntu 2004, Debian9, Debian 10. Default is Ubuntu1804 |
There was a problem hiding this comment.
Yes they get printed
There was a problem hiding this comment.
Ok, then change the casing on the platform strings (all lowercase).
build/bootstrap.sh
Outdated
| #! /bin/bash | ||
|
|
||
| ### | ||
| # This script handles provisioning of the Delivery Optimization client components on supported platforms |
There was a problem hiding this comment.
modify this to read "...handles provisiong of build environment for the Delivery Optimization..." #Resolved
build/bootstrap.sh
Outdated
| echo "[INFO] Platform check succesful" | ||
| else | ||
| echo "[WARNING] No platform supplied, using default: Ubuntu1804" | ||
| PLATFORM = "ubuntu1804" |
There was a problem hiding this comment.
Consider not having a default. It is important enough to explicitly specify. #Closed
|
|
||
| # 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 |
build/bootstrap.sh
Outdated
| $(basename $0) - Script to setup development environments for Delivery Optimization | ||
| Usage: $(basename $0) --platform <platform to install for> --install <install command> | ||
| --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 |
| inputs: | ||
| script: 'sudo ./bootstrap.sh --platform ${{parameters.targetOS}} --install containertools' | ||
| workingDirectory: '$(Build.SourcesDirectory)/build' | ||
| displayName: 'Install Docker' |
There was a problem hiding this comment.
Oops, forgot to remove
| displayName: 'Install libdeliveryoptimization Debian Package' | ||
|
|
||
| - task: PythonScript@0 | ||
| condition: eq('${{parameters.skipTests}}', false) |
There was a problem hiding this comment.
Why remove this condition? No need to build tests in release mode. #Closed
There was a problem hiding this comment.
oops, good catch
| { | ||
| parseArgs "$@" | ||
|
|
||
|
|
There was a problem hiding this comment.
nit: extra space #Resolved
| type: string | ||
|
|
||
| steps: | ||
| - task: Docker@2 |
There was a problem hiding this comment.
I think all the steps from login to install & register qemu can be moved to a new template and referenced from do-docker-jobs.yml.
Not urgent, feel free to open a task. #Closed
There was a problem hiding this comment.
Well, the registering of QEMU will happen during image provisioning (once this script is uploaded as an artifact to Image Factory), which leaves just the login and pull steps, which could be templatized further, but at that point I'm not sure if it's worth it for two tasks
There was a problem hiding this comment.
Agreed, may not be worth it for just a couple of steps.
This is part 1 of the migration work to use 1ES Hosted agents:
TODO:
Native builds are using a 1ES hosted image of a blank Ubuntu 18.04 image, we can use ImageFactory artifacts to preinstall our dependencies to reduce COGS
Docker builds are using Microsoft-hosted agents which contain docker preinstalled, this is because trying to install and use docker on a blank ubuntu 18.04 image leads to permissions issues with the az pipelines agent calling the docker cli
See: https://deliveryoptimization.visualstudio.com/client/_build
All runs succesful