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

feature 2196 update for metbaseimage #2246

Merged
merged 1 commit into from
Aug 30, 2022
Merged
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
1 change: 1 addition & 0 deletions .github/jobs/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CMD_LOGFILE=${GITHUB_WORKSPACE}/docker_build.log

time_command docker build -t ${DOCKERHUB_TAG} \
--build-arg SOURCE_BRANCH \
--build-arg MET_BASE_REPO \
--build-arg MET_BASE_IMAGE \
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE}
if [ $? != 0 ]; then
Expand Down
7 changes: 5 additions & 2 deletions .github/jobs/set_job_controls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ run_push=false
run_unit_tests=false
run_diff=false
run_update_truth=false
met_base_image=minimum
met_base_repo=met-base
met_base_image=v1.0
input_data_version=develop
truth_data_version=develop

Expand Down Expand Up @@ -102,7 +103,7 @@ fi
# if running unit tests, use unit_test MET base image and push image
if [ "$run_unit_tests" == "true" ]; then

met_base_image=unit_test
met_base_repo=met-base-unit-test
run_push=true

fi
Expand All @@ -112,6 +113,7 @@ echo ::set-output name=run_push::$run_push
echo ::set-output name=run_unit_tests::$run_unit_tests
echo ::set-output name=run_diff::$run_diff
echo ::set-output name=run_update_truth::$run_update_truth
echo ::set-output name=met_base_repo::$met_base_repo
echo ::set-output name=met_base_image::$met_base_image
echo ::set-output name=input_data_version::$input_data_version
echo ::set-output name=truth_data_version::$truth_data_version
Expand All @@ -121,6 +123,7 @@ echo run_push: $run_push
echo run_unit_tests: $run_unit_tests
echo run_diff: $run_diff
echo run_update_truth: $run_update_truth
echo met_base_repo: $met_base_repo
echo met_base_image: $met_base_image
echo input_data_version: $input_data_version
echo truth_data_version: $truth_data_version
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_docker_and_trigger_metplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
run: .github/jobs/build_docker_image.sh
env:
SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}-lite
MET_BASE_IMAGE: minimum
MET_BASE_REPO: met-base
MET_BASE_IMAGE: v1.0

- name: Push Docker Image
run: .github/jobs/push_docker_image.sh
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
run_unit_tests: ${{ steps.job_status.outputs.run_unit_tests }}
run_diff: ${{ steps.job_status.outputs.run_diff }}
run_update_truth: ${{ steps.job_status.outputs.run_update_truth }}
met_base_repo: ${{ steps.job_status.outputs.met_base_repo }}
met_base_image: ${{ steps.job_status.outputs.met_base_image }}
branch_name: ${{ steps.job_status.outputs.branch_name }}
truth_data_version: ${{ steps.job_status.outputs.truth_data_version }}
Expand All @@ -74,6 +75,7 @@ jobs:
run: .github/jobs/build_docker_image.sh
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
MET_BASE_REPO: ${{ needs.job_control.outputs.met_base_repo }}
MET_BASE_IMAGE: ${{ needs.job_control.outputs.met_base_image }}

- name: Copy Docker build log into logs directory
Expand Down
5 changes: 3 additions & 2 deletions internal/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG MET_BASE_IMAGE=minimum
ARG MET_BASE_REPO=met-base
ARG MET_BASE_IMAGE=v1.0

FROM dtcenter/met-base:${MET_BASE_IMAGE}
FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_IMAGE}
MAINTAINER John Halley Gotway <johnhg@ucar.edu>

#
Expand Down
5 changes: 3 additions & 2 deletions internal/scripts/docker/Dockerfile.copy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG MET_BASE_IMAGE=minimum
ARG MET_BASE_REPO=met-base
ARG MET_BASE_IMAGE=v1.0

FROM dtcenter/met-base:${MET_BASE_IMAGE}
FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_IMAGE}
MAINTAINER John Halley Gotway <johnhg@ucar.edu>

#
Expand Down
138 changes: 0 additions & 138 deletions internal/scripts/docker/Dockerfile.minimum

This file was deleted.

26 changes: 0 additions & 26 deletions internal/scripts/docker/Dockerfile.test

This file was deleted.

29 changes: 13 additions & 16 deletions internal/scripts/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,36 @@

Run all of the Docker commands from the top-level directory of the MET repository

## Build image with minimum requirements needed to build MET

```docker build -t dtcenter/met-base:minimum -f internal/scripts/docker/Dockerfile.minimum .
docker push dtcenter/met-base:minimum```

## Build image with requirements to build MET and run MET unit tests

```docker build -t dtcenter/met-base:unit_test -f internal/scripts/docker/Dockerfile.test .
docker push dtcenter/met-base:unit_test```

## Build MET from clone

```docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} internal/scripts/docker
docker push dtcenter/met:${TAG_NAME}```
```
docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} internal/scripts/docker
docker push dtcenter/met:${TAG_NAME}
```

where:
* TAG_NAME is the name of the DockerHub tag to create
* BRANCH_NAME is the MET branch to checkout

## Build MET from local source code with minimum requirements

```docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} -f internal/scripts/docker/Dockerfile.copy .
docker push dtcenter/met:${TAG_NAME}```
```
docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} -f internal/scripts/docker/Dockerfile.copy .
docker push dtcenter/met:${TAG_NAME}
```

where:
* TAG_NAME is the name of the DockerHub tag to create
* BRANCH_NAME is the identifier to use for $MET_GIT_NAME inside image

## Build MET from local source code with unit test requirements

```docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} --build-arg MET_BASE_IMAGE=unit_test -f internal/scripts/docker/Dockerfile.copy .
docker push dtcenter/met:${TAG_NAME}```
```
docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} --build-arg MET_BASE_IMAGE=unit_test_${MET_BASE_IMAGE_VERSION} -f internal/scripts/docker/Dockerfile.copy .
docker push dtcenter/met:${TAG_NAME}
```

where:
* TAG_NAME is the name of the DockerHub tag to create
* BRANCH_NAME is the identifier to use for $MET_GIT_NAME inside image
* MET_BASE_IMAGE_VERSION is the METbaseimage tag version number