Oryx/build
snehapar9 5efb1fd089
Add support for python latest versions (#1647)
* Add support for python latest versions

* generated constants

* Updated runtime tag

* generated constants

* Updated unit tests

* updated runtime tag

* updated constants

* Removed extra space character

* Added new python versions to all os types

* Updated tests

* Updated tests

* convert go fully to go.mod

* removed gopkg files, adn fully built all go packages with dependencies

* fixed tests to run on packages

* cleaned up scripts

* removed built exes

* make mod files consistent

* allow execution of the test packages script

* Fixed bug to download tarballs from storage account url supplied from pipeline

* Fix bug to download sdks from storage account url supplied from pipeline

* Add AddDefaultTestEnvironmentVariables

* Replcae SetEnvironmentVariable by AddDefaultTestEnvironmentVariables

* Commented out test for python 3.11

* Add support for python latest versions

* generated constants

* Updated runtime tag

* generated constants

* Updated unit tests

* updated runtime tag

* updated constants

* Removed extra space character

* Added new python versions to all os types

* Updated tests

* Updated tests

* Fixed bug to download tarballs from storage account url supplied from pipeline

* Fix bug to download sdks from storage account url supplied from pipeline

* fixed tests to run on packages

* cleaned up scripts

* Add AddDefaultTestEnvironmentVariables

* Replcae SetEnvironmentVariable by AddDefaultTestEnvironmentVariables

* Commented out test for python 3.11

* Add dotnet 7 to stretch / older images (#1667)

* add dotnet 7 to stretch / legacy images

* generated constants and supported versions, and updated the final stretch version for dotnet 7

* remove .NET7 condition on bindport2 (#1670)

* Pauld/switch go packages to go mod (#1671)

* convert go fully to go.mod

* removed gopkg files, adn fully built all go packages with dependencies

* fixed tests to run on packages

* cleaned up scripts

* removed built exes

* make mod files consistent

* allow execution of the test packages script

* added readme for updating and testing go dependencies

* Add support for python latest versions

* generated constants

* Updated runtime tag

* generated constants

* Updated unit tests

* updated runtime tag

* updated constants

* Removed extra space character

* Added new python versions to all os types

* Updated tests

* Updated tests

* Fixed bug to download tarballs from storage account url supplied from pipeline

* Fix bug to download sdks from storage account url supplied from pipeline

* fixed tests to run on packages

* cleaned up scripts

* Add AddDefaultTestEnvironmentVariables

* Replcae SetEnvironmentVariable by AddDefaultTestEnvironmentVariables

* Commented out test for python 3.11

* also add execution permissions for the restore packages script

* reordered testing shell script builder methods

* Updated error message

* Fixed astroid version conflict

* Fixed version conflict with astroid 2.8.0

* Fixed astroid 2.8.0 version conflict

* Addressed PR comments and resolved dependency conflict

* Resolved pyflakes version conflict

* Enabled test case to use default test env variables

* Resolved dependency conflicts

* Updated runtime tag

Co-authored-by: Paul Dorsch <pauldorsch@microsoft.com>
Co-authored-by: Paul Dorsch <107068277+pauld-msft@users.noreply.github.com>
Co-authored-by: waliMSFT <105239794+waliMSFT@users.noreply.github.com>
2022-11-18 11:06:24 -08:00
..
detector Create a new Detector solution, pipeline and nuget packages (#608) 2020-06-22 16:30:38 -07:00
tools Pauld/net 7 ga updates (#1660) 2022-11-07 21:47:25 -08:00
FinalPublicKey.snk Merged PR 138760: Initial implementation of the script generation tool with Node.JS 2018-08-31 21:45:09 +00:00
Readme.md update doc (#783) 2020-09-23 11:23:21 -07:00
TestAssembliesKey.snk Merged PR 138760: Initial implementation of the script generation tool with Node.JS 2018-08-31 21:45:09 +00:00
__condaConstants.sh Update Hugo | Yarn | Conda (#1352) 2022-04-27 13:04:30 -07:00
__dotNetCoreRunTimeVersions.sh add support for .net 6.0.11 and .net core 3.1.31 (#1677) 2022-11-11 12:08:40 -05:00
__dotNetCoreSdkVersions.sh add support for .net 6.0.11 and .net core 3.1.31 (#1677) 2022-11-11 12:08:40 -05:00
__extVarNames.sh Pauld/1559705 improve cli to detect viable sdks based on debian flavor (#1484) 2022-08-15 13:35:32 -04:00
__finalStretchVersions.sh Add dotnet 7 to stretch / older images (#1667) 2022-11-09 09:50:40 -05:00
__functions.sh Pauld/add support for staging runtime images (#1643) 2022-10-31 19:23:34 -04:00
__goVersions.sh Remove bullseye package dependency for ca-certificates to avoid build failure (#936) 2021-02-22 20:20:04 -08:00
__golangVersions.sh Snehapar/1588872 upgrade golang version to 1.19 and change to bullseye (#1533) 2022-08-26 17:03:54 -07:00
__hugoConstants.sh Update Hugo | Yarn | Conda (#1352) 2022-04-27 13:04:30 -07:00
__javaVersions.sh Add java 11.0.14 (#1348) 2022-04-26 12:09:35 -07:00
__nodeVersions.sh Update Node version to lts hydrogen (#1658) 2022-11-12 20:16:19 -08:00
__phpVersions.sh Add sqlsrv to PHP FPM 8.1 runtime image (#1623) 2022-10-24 12:19:59 -07:00
__pythonVersions.sh Add support for python latest versions (#1647) 2022-11-18 11:06:24 -08:00
__rubyVersions.sh Update CLI image and Dockerfile command for more robust builds/runs (#1380) 2022-05-12 12:56:21 -07:00
__sdkStorageConstants.sh Wali/1634821 adopting private dotnet binaries (#1644) 2022-11-01 20:55:30 -04:00
__stagingRuntimeConstants.sh Pauld/net 7 ga updates (#1660) 2022-11-07 21:47:25 -08:00
__variables.sh Pauld/add support for staging runtime images (#1643) 2022-10-31 19:23:34 -04:00
buildBuildImageBases.sh Pauld/add support for staging runtime images (#1643) 2022-10-31 19:23:34 -04:00
buildBuildImages.sh Add support for python latest versions (#1647) 2022-11-18 11:06:24 -08:00
buildBuildpacksImages.sh update pack tool version (#1009) 2021-05-13 17:08:53 -07:00
buildPlatformBinaries.sh Pauld/1597308 parameterize pipelines (#1534) 2022-08-30 13:45:28 -04:00
buildPythonSdkByVersion.sh Bump up viztracer version and pull binaries from storage account for … (#1661) 2022-11-11 10:06:14 -08:00
buildRunTimeImageBases.sh Pauld/net 7 ga updates (#1660) 2022-11-07 21:47:25 -08:00
buildRunTimeImages.sh Pauld/add support for staging runtime images (#1643) 2022-10-31 19:23:34 -04:00
buildSln.sh Create a new Detector solution, pipeline and nuget packages (#608) 2020-06-22 16:30:38 -07:00
buildTestBuildImages.sh Add back multistage tests for stretch and buster previously removed (#1596) 2022-10-04 09:01:31 -07:00
calculateContainerSizes.sh Pauld/1568462 cut down skeleton/cli image (#1492) 2022-08-09 15:45:49 -04:00
constants.yaml Add support for python latest versions (#1647) 2022-11-18 11:06:24 -08:00
createSymlinksForDotnet.sh Williamhe/1562986 add vso bullseye image (#1554) 2022-09-09 20:24:50 -07:00
generateConstants.sh Added option to limit the scope of the generated C# constants file and some enhancements. (#660) 2020-07-02 14:14:56 -07:00
release.txt Adding automatic release notes from changelog file. (#16) 2019-03-25 17:04:40 -07:00
testBuildImages.sh Pauld/1597308 parameterize pipelines (#1534) 2022-08-30 13:45:28 -04:00
testBuildScriptGenerator.sh Create a new Detector solution, pipeline and nuget packages (#608) 2020-06-22 16:30:38 -07:00
testDetector.sh Added tests for Detector nuget package (#676) 2020-07-09 14:25:28 -07:00
testIntegration.sh Pauld/1597308 parameterize pipelines (#1534) 2022-08-30 13:45:28 -04:00
testRunTimeImages.sh Pauld/1597308 parameterize pipelines (#1534) 2022-08-30 13:45:28 -04:00
testStartupScriptGenerators.sh Add support for python latest versions (#1647) 2022-11-18 11:06:24 -08:00

Readme.md

Why so many scripts?

The scripts in this folder are broken down into different layers to enable a good development as a well as CI experience.
So if a user wants to just build and test build images, they can do so by running its respective script.
These scripts are actually called in VSTS pipelines too (Check the vsts/pipelines/templates/_buildTemplate.yml file).

Artifact files

Building build and runtime images can conceptually be viewed as building a .NET repo's 'src' folder where after successfully
building the output is written to a artifacts folder. In a similar way, after building build/runtime images, we write out
the names of the images that were built to files '/artifacts/images/build-images.txt' and '/artifacts/images/runtime-images.txt'.
This is the same experience if the images were built locally on a dev machine or a CI agent. The idea is that in case of CI agent,
when a VSTS task needs to push images to a docker registry, it can just consume these artifact files to figure out which images to push.

Untagging images

Taggig a docker image is actually tagging or pinning docker layers. Since a CI agent can go through several builds a day we would be
in the risk of running out of disk space. So we want to make sure to not pin layers which are not used anymore. For example,
Let's say the following docker file was built with 2 tags called 'test:latest' and 'test:buildnumber1'. Let's call the individual
layers as L1, L2 and L3.

FROM busybox                        <-- L1
RUN echo hello > hello.txt          <-- L2
RUN echo hi > hi.txt                <-- L3

Now let's say this docker file was changed in the following way and a new docker build is done with 2 tags called 'test:latest'
and 'test:buildnumber2'. When the following docker file is built there would be new layers called L22 and L33.

FROM busybox                        <-- L1
RUN echo hello-updated > hello.txt  <-- L22
RUN echo hi > hi.txt                <-- L33

At this point the 'latest' and 'buildnumber2' tags are pointing to L33 layer and ideally we do not want to keep the layers L2 and L3
around as they are not going to be used anyway and just consume disk space. But they are still pinned via the tag 'buildnumber1'.

So, to prevent this we try to unpin/untag a build number based tag (not the 'latest' tag because its a moving tag) which will
create dangling layers/images helping us to cleanup (for example, L2 and L3 would no longer have any references and can be cleaned up).

Why tag intermediate stages in the multi-stage build image dockerfile?

As of docker version 18.06.1-ce, whenever docker builds a multi-stage dockerfile, it only tags the layer of the final FROM related
image. Since intermediate FROM statements exist in a multi-stage process, their layers are left dangled. This is problematic for us
because we, in general, want to clean out dangling images (for example, frequent changes to BuildScriptGenerator tool results in
dangling images which we want to clean) to avoid running into disk space problems. So, to prevent these dangling intermediate FROM
statement related images from being cleaned up (i.e rebuilding the whole stage again from scratch), we tag them. These images are
however never pushed to the server and only exist on the machine where the image was built.