Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): remove option to tag java 11 images #218

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ on:
- 'false'
type: choice
required: true
tagJava11:
description: 'Tag Java 11 variants of images. Only set to True for versions after 1.32.0.'
default: 'true'
options:
- 'true'
- 'false'
type: choice
required: true

jobs:
release:
Expand Down Expand Up @@ -71,7 +63,6 @@ jobs:
minimum Halyard version: ${{ inputs.minimumHalyardVersion }}
latest Halyard version: ${{ inputs.latestHalyardVersion }}
dry run enabled: ${{ inputs.dryRun }}
tag Java 11 variants: ${{ inputs.tagJava11 }}"

- name: Login to GAR
# This is required to tag docker images
Expand Down Expand Up @@ -103,7 +94,6 @@ jobs:
--github_owner "${{ steps.release_info.outputs.REPOSITORY_OWNER }}" \
--github_oauth_token "${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}" \
--dry_run ${{ inputs.dryRun }} \
--tag_java11 ${{ inputs.tagJava11 }}

- name: Cat output files for review
run: |
Expand Down
12 changes: 0 additions & 12 deletions dev/buildtool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@

# pylint: disable=wrong-import-position

SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES = [
"clouddriver",
"echo",
"fiat",
"front50",
"gate",
"igor",
"kayenta",
"orca",
"rosco"
]

# These would be required if running from source code
SPINNAKER_RUNNABLE_REPOSITORY_NAMES = [
"clouddriver",
Expand Down
22 changes: 0 additions & 22 deletions dev/buildtool/container_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from buildtool import (
SPINNAKER_DOCKER_REGISTRY,
SPINNAKER_RUNNABLE_REPOSITORY_NAMES,
SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES,
CommandFactory,
CommandProcessor,
check_options_set,
Expand Down Expand Up @@ -74,15 +73,6 @@ def init_argparser(self, parser, defaults):
help="Show proposed actions, don't actually do them. Default True.",
)

self.add_argument(
parser,
"tag_java11",
defaults,
True,
type=bool,
help="Tag JRE 11 variants of images for specified services. Default True.",
)


class TagContainersCommand(CommandProcessor):
"""Implements tag_containers command."""
Expand Down Expand Up @@ -136,9 +126,6 @@ def _do_command(self):
existing_image = (
f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{version}-unvalidated"
)
existing_image_java11 = (
f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{version}-java11-unvalidated"
)

tag_permutations = [f"{version}", f"spinnaker-{options.spinnaker_version}"]

Expand All @@ -152,8 +139,6 @@ def _do_command(self):
continue

logging.info("Tagging container: %s(-ubuntu)", existing_image)
if options.tag_java11 and service in SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES:
logging.info("Tagging JRE 11 container variants: %s(-ubuntu)", existing_image_java11)

for tag in tag_permutations:
alpine_image = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}"
Expand All @@ -162,13 +147,6 @@ def _do_command(self):
ubuntu_image = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}-ubuntu"
self.regctl_image_copy(f"{existing_image}-ubuntu", ubuntu_image)

if options.tag_java11 and service in SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES:
alpine_image_java11 = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}-java11"
self.regctl_image_copy(existing_image_java11, alpine_image_java11)

ubuntu_image_java11 = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}-java11-ubuntu"
self.regctl_image_copy(f"{existing_image_java11}-ubuntu", ubuntu_image_java11)


def register_commands(registry, subparsers, defaults):
"""Registers all the commands for this module."""
Expand Down
8 changes: 0 additions & 8 deletions dev/buildtool/spinnaker_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ def init_argparser(self, parser, defaults):
type=bool,
help="Show proposed actions, don't actually do them. Default True.",
)
self.add_argument(
parser,
"tag_java11",
defaults,
True,
type=bool,
help="Tag JRE 11 variants of images for specified services. Default True.",
)


class PublishSpinnakerCommand(CommandProcessor):
Expand Down
23 changes: 1 addition & 22 deletions unittest/buildtool/container_commands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def test_default_tag_containers_options(self):
option_dict = vars(options)

self.assertEqual(True, options.dry_run)
self.assertEqual(True, options.tag_java11)

self.assertIsNone(option_dict["bom_path"])
self.assertIsNone(option_dict["spinnaker_version"])
Expand All @@ -62,7 +61,6 @@ def test_tag_containers_dry_run(self):
os.path.dirname(__file__), "standard_test_bom.yml"
)
options.dry_run = True
options.tag_java11 = True

mock_regctl_image_copy = self.patch_method(
TagContainersCommand, "regctl_image_copy"
Expand Down Expand Up @@ -91,7 +89,6 @@ def test_tag_containers(self):
os.path.dirname(__file__), "standard_test_bom.yml"
)
options.dry_run = False
options.tag_java11 = True

mock_regctl_image_copy = self.patch_method(
TagContainersCommand, "regctl_image_copy"
Expand All @@ -111,7 +108,6 @@ def test_tag_containers(self):
# without "-unvalidated" and with "spinnaker-{version}", 4 variations
# each service (2 services), 8 permutations.
# BOM service "monitoring-third-party" should be ignored.
# When tag_java11 flag set, extra 4 permutations per service
calls = [
call(
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated",
Expand All @@ -121,14 +117,6 @@ def test_tag_containers(self):
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated-ubuntu",
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-ubuntu",
),
call(
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated",
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11",
),
call(
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated-ubuntu",
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-ubuntu",
),
call(
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated",
f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3",
Expand All @@ -137,14 +125,6 @@ def test_tag_containers(self):
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated-ubuntu",
f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3-ubuntu",
),
call(
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated",
f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3-java11",
),
call(
f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated-ubuntu",
f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3-java11-ubuntu",
),
call(
f"{SPINNAKER_DOCKER_REGISTRY}/monitoring-daemon:7.8.9-20180908070605-unvalidated",
f"{SPINNAKER_DOCKER_REGISTRY}/monitoring-daemon:7.8.9-20180908070605",
Expand All @@ -166,8 +146,7 @@ def test_tag_containers(self):
mock_regctl_image_copy.assert_has_calls(calls)

# Should only be eight permutations, no more (e.g: NOT monitoring-third-party)
# Should be 12 when tagging JRE 11 images for front50 only
self.assertEqual(mock_regctl_image_copy.call_count, 12)
self.assertEqual(mock_regctl_image_copy.call_count, 8)


if __name__ == "__main__":
Expand Down