Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f03b298
CLOUDP-83092: Add init container images to inventory file
chatton Apr 20, 2021
5373ffa
updated evergreen.yml
chatton Apr 20, 2021
363e140
fixed .evergreen.yml
chatton Apr 20, 2021
92fd0d8
add release tasks for hooks
chatton Apr 20, 2021
b9cfe85
release to correct registry
chatton Apr 20, 2021
a6b9103
add release tasks for probes
chatton Apr 21, 2021
8fa828d
Merge branch 'master' into CLOUDP-83092_add_release_task_for_init_con…
chatton Apr 21, 2021
8ebb780
added agent context images
chatton Apr 21, 2021
b642729
corrected skiptags
chatton Apr 21, 2021
1cafc42
Merge branch 'CLOUDP-83092_add_release_task_for_init_containers' of g…
chatton Apr 21, 2021
4c40f97
added ensure_tag function
chatton Apr 21, 2021
5f3a84d
added type hinting for list
chatton Apr 21, 2021
5e9413e
added tags
chatton Apr 21, 2021
cfa0c43
added ubuntu and ubi tags
chatton Apr 21, 2021
a7bed44
merge master
chatton Apr 21, 2021
151c70d
add release tasks for init container
chatton Apr 21, 2021
a382dae
merged branch
chatton Apr 21, 2021
d285dc8
add s3 vars
chatton Apr 21, 2021
2c33258
added expansions to env
chatton Apr 21, 2021
34ca677
ensure label is Never for releases
chatton Apr 21, 2021
ed2a0ac
added release tasks which publish to s3 and push context
chatton Apr 21, 2021
1cdd8bc
added expire after
chatton Apr 21, 2021
69ee54d
merged master
chatton Apr 22, 2021
d81367b
Merge branch 'CLOUDP-83092_add_context_image_for_agents' into CLOUDP-…
chatton Apr 22, 2021
b435456
addressed PR feedback
chatton Apr 23, 2021
fc01018
Merge branch 'master' into CLOUDP-83092_add_context_image_for_agents
chatton Apr 23, 2021
1cdab87
Merge branch 'CLOUDP-83092_add_context_image_for_agents' into CLOUDP-…
chatton Apr 23, 2021
da4ba64
merged master
chatton Apr 26, 2021
7bcd758
upgrade sonar to 0.0.10
chatton Apr 26, 2021
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
2 changes: 2 additions & 0 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ functions:
params:
env:
MONGODB_COMMUNITY_CONFIG: ${workdir}/mongodb-kubernetes-operator/scripts/ci/config.json
AWS_ACCESS_KEY_ID: ${community_aws_access_key_id}
AWS_SECRET_ACCESS_KEY: ${community_aws_secret_access_key}
include_expansions_in_env:
- version_id
- quay_user_name
Expand Down
58 changes: 48 additions & 10 deletions inventory.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
vars:
registry: <registry>
s3_bucket_http: https://enterprise-operator-dockerfiles.s3.amazonaws.com/dockerfiles/mongodb-agent
s3_bucket: s3://enterprise-operator-dockerfiles/dockerfiles/mongodb-agent

images:
- name: agent-ubuntu
Expand Down Expand Up @@ -31,11 +33,6 @@ images:
tags: ["ubuntu"]
distro: ubuntu

# TODO: remove - this is only here as sonar raises a key error on version_id
# if no other inputs are specified.
inputs:
- noop

output:
- dockerfile: scripts/dev/templates/agent/Dockerfile.ubuntu-$(inputs.params.version_id)

Expand All @@ -55,6 +52,29 @@ images:
- registry: $(inputs.params.registry)/mongodb-agent-ubuntu-dev
tag: $(inputs.params.version_id)

- name: agent-template-ubuntu-s3
task_type: dockerfile_template
tags: ["ubuntu", "release"]
distro: ubuntu

inputs:
- release_version

output:
- dockerfile: $(inputs.params.s3_bucket)/Dockerfile.ubuntu-$(inputs.params.release_version)

- name: agent-context-ubuntu-release
task_type: tag_image
tags: ["ubuntu", "release"]
distro: ubuntu

source:
registry: $(inputs.params.registry)/agent-ubuntu-context-dev
tag: $(inputs.params.version_id)

destination:
- registry: $(inputs.params.registry)/mongodb-agent-ubuntu-context
tag: $(inputs.params.release_version)-context

- name: agent-ubi
vars:
Expand Down Expand Up @@ -86,11 +106,6 @@ images:
distro: ubi
tags: ["ubi"]

# TODO: remove - this is only here as sonar raises a key error on version_id
# if no other inputs are specified.
inputs:
- noop

output:
- dockerfile: scripts/dev/templates/agent/Dockerfile.ubi-$(inputs.params.version_id)

Expand All @@ -110,6 +125,29 @@ images:
- registry: $(inputs.params.registry)/mongodb-agent-ubi-dev
tag: $(inputs.params.version_id)

- name: agent-template-ubi-s3
task_type: dockerfile_template
tags: ["ubi", "release"]
distro: ubi

inputs:
- release_version

output:
- dockerfile: $(inputs.params.s3_bucket)/Dockerfile.ubi-$(inputs.params.release_version)

- name: agent-context-ubi-release
task_type: tag_image
tags: ["ubi", "release"]
distro: ubi

source:
registry: $(inputs.params.registry)/agent-ubi-context-dev
tag: $(inputs.params.version_id)

destination:
- registry: $(inputs.params.registry)/mongodb-agent-ubi-context
tag: $(inputs.params.release_version)-context

- name: readiness-probe-init
vars:
Expand Down
26 changes: 12 additions & 14 deletions pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,24 @@
DEFAULT_NAMESPACE = "default"


def build_agent_image_ubi(config: DevConfig) -> None:
image_name = "agent-ubi"
def _load_release() -> Dict:
with open("release.json") as f:
release = json.loads(f.read())
return release

args = {

def _build_agent_args(config: DevConfig) -> Dict[str, str]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these values are shared in both agent images.

release = _load_release()
return {
"agent_version": release["agent"]["version"],
"tools_version": release["agent"]["tools_version"],
"registry": config.repo_url,
}


def build_agent_image_ubi(config: DevConfig) -> None:
image_name = "agent-ubi"
args = _build_agent_args(config)
config.ensure_tag_is_run("ubi")

sonar_build_image(
Expand All @@ -42,14 +49,7 @@ def build_agent_image_ubi(config: DevConfig) -> None:

def build_agent_image_ubuntu(config: DevConfig) -> None:
image_name = "agent-ubuntu"
with open("release.json") as f:
release = json.loads(f.read())
args = {
"agent_version": release["agent"]["version"],
"tools_version": release["agent"]["tools_version"],
"registry": config.repo_url,
}

args = _build_agent_args(config)
config.ensure_tag_is_run("ubuntu")

sonar_build_image(
Expand All @@ -60,9 +60,7 @@ def build_agent_image_ubuntu(config: DevConfig) -> None:


def build_readiness_probe_image(config: DevConfig) -> None:
with open("release.json") as f:
release = json.loads(f.read())

release = _load_release()
config.ensure_tag_is_run("readiness-probe")

sonar_build_image(
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/setup_virtualenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ virtualenv --python /opt/python/3.7/bin/python3 ./venv
pip3 install -r ./requirements.txt

# shellcheck disable=SC2154
pip3 install "git+https://${sonar_github_token}@github.com/10gen/sonar.git@0.0.9"
pip3 install "git+https://${sonar_github_token}@github.com/10gen/sonar.git@0.0.10"