зеркало из https://github.com/microsoft/Oryx.git
Snehapar/1588872 upgrade golang version to 1.19 and change to bullseye (#1533)
* Upgrade golang to 1.19 and migrate to bullseye * Generated Golang19Version * Removed echo * Made modifications to build full-bullseye image * Modified full.Dockerfile to add buster * Added tests for golang 1.18 and 1.19 * Replaced hardcoded build image name * Modified test to handle full, full-buster,full-bullseye
This commit is contained in:
Родитель
24032445db
Коммит
7b88aad858
|
@ -6,3 +6,5 @@ GOLANG17_VERSION='1.17'
|
|||
GOLANG17_TAR_SHA256='6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d'
|
||||
GOLANG18_VERSION='1.18'
|
||||
GOLANG18_TAR_SHA256='e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f'
|
||||
GOLANG19_VERSION='1.19'
|
||||
GOLANG19_TAR_SHA256='464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6'
|
||||
|
|
|
@ -415,8 +415,8 @@ function buildFullImage() {
|
|||
|
||||
if [ -z "$debianFlavor" ] || [ "$debianFlavor" == "stretch" ]; then
|
||||
debianFlavor="stretch"
|
||||
elif [ "$debianFlavor" == "buster" ]; then
|
||||
debianFlavor="buster"
|
||||
elif [ "$debianFlavor" == "buster" ] || [ "$debianFlavor" == "bullseye" ]; then
|
||||
debianFlavor=$debianFlavor
|
||||
devImageTag=$devImageTag-$debianFlavor
|
||||
echo "dev image tag: "$devImageTag
|
||||
builtImageName=$builtImageName-$debianFlavor
|
||||
|
@ -471,6 +471,7 @@ if [ -z "$imageTypeToBuild" ]; then
|
|||
buildCliImage
|
||||
buildBuildPackImage
|
||||
buildFullImage "buster"
|
||||
buildFullImage "bullseye"
|
||||
elif [ "$imageTypeToBuild" == "githubactions" ]; then
|
||||
buildGitHubActionsImage
|
||||
buildGitHubActionsImage "buster"
|
||||
|
@ -499,6 +500,7 @@ elif [ "$imageTypeToBuild" == "ltsversions-buster" ]; then
|
|||
elif [ "$imageTypeToBuild" == "latest" ]; then
|
||||
buildLatestImages
|
||||
elif [ "$imageTypeToBuild" == "full" ]; then
|
||||
buildFullImage "bullseye"
|
||||
buildFullImage "buster"
|
||||
elif [ "$imageTypeToBuild" == "vso-focal" ]; then
|
||||
buildVsoFocalImage
|
||||
|
|
|
@ -111,6 +111,8 @@
|
|||
golang17-tar-sha256: 6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d
|
||||
golang18-version: 1.18
|
||||
golang18-tar-sha256: e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f
|
||||
golang19-version: 1.19
|
||||
golang19-tar-sha256: 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6
|
||||
outputs:
|
||||
- type: csharp
|
||||
directory: src/BuildScriptGenerator
|
||||
|
|
|
@ -227,6 +227,7 @@
|
|||
- 1.16.7
|
||||
- 1.17
|
||||
- 1.18
|
||||
- 1.19
|
||||
|
||||
### buster
|
||||
|
||||
|
@ -235,6 +236,7 @@
|
|||
- 1.16.7
|
||||
- 1.17
|
||||
- 1.18
|
||||
- 1.19
|
||||
|
||||
### focal-scm
|
||||
|
||||
|
@ -243,6 +245,7 @@
|
|||
- 1.16.7
|
||||
- 1.17
|
||||
- 1.18
|
||||
- 1.19
|
||||
|
||||
### stretch
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ ARG DEBIAN_FLAVOR
|
|||
|
||||
### oryx run-script image
|
||||
# DisableDockerDetector "Below image not yet supported in the Docker Hub mirror"
|
||||
FROM golang:1.15-${DEBIAN_FLAVOR} as startupScriptGens
|
||||
FROM golang:1.19-${DEBIAN_FLAVOR} as startupScriptGens
|
||||
|
||||
# GOPATH is set to "/go" in the base image
|
||||
WORKDIR /go/src
|
||||
|
@ -27,8 +27,15 @@ COPY --from=oryxdevmcr.azurecr.io/private/oryx/support-files-image-for-build /tm
|
|||
COPY --from=oryxdevmcr.azurecr.io/private/oryx/buildscriptgenerator /opt/ /opt/
|
||||
COPY --from=startupScriptGens /opt/startupcmdgen/ /opt/startupcmdgen/
|
||||
|
||||
RUN if [ "${DEBIAN_FLAVOR}" = "buster" ]; then \
|
||||
RUN if [ "${DEBIAN_FLAVOR}" = "bullseye" ]; then \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
libicu67 \
|
||||
libcurl4 \
|
||||
libssl1.1 \
|
||||
&& rm -rf /var/lib/apt/lists/* ; \
|
||||
elif [ "${DEBIAN_FLAVOR}" = "buster" ]; then \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
libicu63 \
|
||||
libcurl4 \
|
||||
|
@ -42,6 +49,7 @@ RUN if [ "${DEBIAN_FLAVOR}" = "buster" ]; then \
|
|||
liblttng-ust0 \
|
||||
libssl1.0.2 \
|
||||
&& rm -rf /var/lib/apt/lists/* ; \
|
||||
|
||||
fi
|
||||
|
||||
RUN apt-get update \
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
1.15.15, 0885cf046a9f099e260d98d9ec5d19ea9328f34c8dc4956e1d3cd87daaddb345,
|
||||
1.16.7, 7fe7a73f55ba3e2285da36f8b085e5c0159e9564ef5f63ee0ed6b818ade8ef04,
|
||||
1.17, 6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d,
|
||||
1.18, e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f,
|
||||
1.18, e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f,
|
||||
1.19, 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6,
|
|
@ -3,4 +3,5 @@
|
|||
1.15.15, 0885cf046a9f099e260d98d9ec5d19ea9328f34c8dc4956e1d3cd87daaddb345,
|
||||
1.16.7, 7fe7a73f55ba3e2285da36f8b085e5c0159e9564ef5f63ee0ed6b818ade8ef04,
|
||||
1.17, 6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d,
|
||||
1.18, e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f,
|
||||
1.18, e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f,
|
||||
1.19, 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6,
|
|
@ -3,4 +3,5 @@
|
|||
1.15.15, 0885cf046a9f099e260d98d9ec5d19ea9328f34c8dc4956e1d3cd87daaddb345,
|
||||
1.16.7, 7fe7a73f55ba3e2285da36f8b085e5c0159e9564ef5f63ee0ed6b818ade8ef04,
|
||||
1.17, 6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d,
|
||||
1.18, e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f,
|
||||
1.18, e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f,
|
||||
1.19, 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6,
|
|
@ -10,5 +10,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator.Common
|
|||
public const string Golang17TarSha256 = "6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d";
|
||||
public const string Golang18Version = "1.18";
|
||||
public const string Golang18TarSha256 = "e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f";
|
||||
public const string Golang19Version = "1.19";
|
||||
public const string Golang19TarSha256 = "464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6";
|
||||
}
|
||||
}
|
|
@ -22,28 +22,37 @@ namespace Microsoft.Oryx.Integration.Tests
|
|||
{
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CanRunApp_WithoutBuildManifestFileAsync()
|
||||
|
||||
|
||||
[Theory]
|
||||
[InlineData("1.17", "buster")]
|
||||
[InlineData("1.17", "bullseye")]
|
||||
[InlineData("1.18", "buster")]
|
||||
[InlineData("1.18", "bullseye")]
|
||||
[InlineData("1.19", "buster")]
|
||||
[InlineData("1.19", "bullseye")]
|
||||
public async Task CanRunApp_WithoutBuildManifestFileAsync(string golangVersion, string debianFlavor)
|
||||
{
|
||||
// Arrange
|
||||
var golangVersion = "1.17";
|
||||
var hostDir = Path.Combine(_hostSamplesDir, "golang", GolangHelloWorldWebApp);
|
||||
var volume = DockerVolume.CreateMirror(hostDir);
|
||||
var appDir = volume.ContainerDir;
|
||||
var appOutputDirVolume = CreateAppOutputDirVolume();
|
||||
var appOutputDir = appOutputDirVolume.ContainerDir;
|
||||
var imageTestHelper = new ImageTestHelper();
|
||||
var runtimeImageScript = new ShellScriptBuilder()
|
||||
.AddDefaultTestEnvironmentVariables()
|
||||
.AddCommand(
|
||||
$"oryx build {appDir} -i /tmp/int -o {appOutputDir} " +
|
||||
$"--platform {GolangConstants.PlatformName} --platform-version {golangVersion}")
|
||||
.AddCommand(
|
||||
$"oryx run-script {appOutputDir} --output {DefaultStartupFilePath} --debug")
|
||||
$"oryx run-script --platform {GolangConstants.PlatformName} --platform-version {golangVersion} {appOutputDir} --output {DefaultStartupFilePath} --debug")
|
||||
.AddCommand(DefaultStartupFilePath)
|
||||
.ToString();
|
||||
|
||||
// Assert
|
||||
await EndToEndTestHelper.RunAndAssertAppAsync(
|
||||
imageName: "oryxdevmcr.azurecr.io/public/oryx/build:full",
|
||||
imageName: $"{imageTestHelper.GetBuildImage($"full-{debianFlavor}")}",
|
||||
output: _output,
|
||||
volumes: new List<DockerVolume> { appOutputDirVolume, volume },
|
||||
environmentVariables: null,
|
||||
|
|
|
@ -40,6 +40,9 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
private const string _latestTag = "latest";
|
||||
private const string _ltsVersionsTag = "lts-versions";
|
||||
private const string _ltsVersionsBuster = "lts-versions-buster";
|
||||
private const string _full = "full";
|
||||
private const string _fullBullseye = "full-bullseye";
|
||||
private const string _fullBuster = "full-buster";
|
||||
|
||||
private readonly ITestOutputHelper _output;
|
||||
private string _repoPrefix;
|
||||
|
@ -211,6 +214,19 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
{
|
||||
return GetCliImage(_cliBusterRepository);
|
||||
}
|
||||
else if (string.Equals(tag, _full))
|
||||
{
|
||||
return GetFullBuildImage(_full);
|
||||
}
|
||||
else if (string.Equals(tag, _fullBullseye))
|
||||
{
|
||||
return GetFullBuildImage(_fullBullseye);
|
||||
}
|
||||
else if (string.Equals(tag, _fullBuster))
|
||||
{
|
||||
return GetFullBuildImage(_fullBuster);
|
||||
}
|
||||
|
||||
throw new NotSupportedException($"A build image cannot be created with the given tag '{tag}'.");
|
||||
}
|
||||
|
||||
|
@ -346,5 +362,21 @@ namespace Microsoft.Oryx.Tests.Common
|
|||
|
||||
return _tagSuffix;
|
||||
}
|
||||
|
||||
private string GetFullBuildImage(string debianFlavor = null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _fullBuster))
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_fullBuster}{_tagSuffix}";
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(debianFlavor) && string.Equals(debianFlavor.ToLower(), _fullBullseye))
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_fullBullseye}{_tagSuffix}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"{_repoPrefix}/{_buildRepository}:{_full}{_tagSuffix}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче