From f535eabdf406296432fe5aff80fe92e0f4cbfc77 Mon Sep 17 00:00:00 2001 From: rpoluri <38321430+rpoluri@users.noreply.github.com> Date: Wed, 2 Sep 2020 13:23:20 -0500 Subject: [PATCH] Feature/single image (#83) * add allow-grant.sh to main container * update changelog * Feature/single image ci fixes (#84) * remove ci fixes * remove workflow from test in main.yml Co-authored-by: Raj Poluri Co-authored-by: Ken Figueiredo --- .github/workflows/main.yml | 15 --------------- .github/workflows/release.yml | 21 +-------------------- CHANGELOG.md | 8 ++++++++ Dockerfile | 2 ++ {initContainer => files}/allow-grant.sh | 0 {initContainer => files}/db-iam-user.sh | 0 initContainer/Dockerfile | 11 ----------- initContainer/README.md | 21 --------------------- 8 files changed, 11 insertions(+), 67 deletions(-) rename {initContainer => files}/allow-grant.sh (100%) mode change 100644 => 100755 rename {initContainer => files}/db-iam-user.sh (100%) delete mode 100644 initContainer/Dockerfile delete mode 100644 initContainer/README.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5fa0526..637b757 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,18 +16,3 @@ jobs: dockerfile: "Dockerfile" always_pull: true push: false - - apiary-init-docker-image: - name: Apiary Init Container Docker Checks - runs-on: ubuntu-18.04 - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Ensure Apiary Init Docker Image Builds. - uses: docker/build-push-action@v1.1.0 - with: - path: "initContainer" - dockerfile: "initContainer/Dockerfile" - always_pull: true - push: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c971d9..36e6b65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,23 +22,4 @@ jobs: repository: expediagroup/apiary-metastore-core username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - push: ${{ startsWith(github.ref, 'refs/tags/') }} - - apiary-init-docker-image: - name: Apiary Init Container Docker Release - runs-on: ubuntu-18.04 - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Release Apiary Init Docker Image - uses: docker/build-push-action@v1.1.0 - with: - path: "initContainer" - dockerfile: "initContainer/Dockerfile" - always_pull: true - tag_with_ref: true - repository: expediagroup/apiary-metastore-init-container - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - push: ${{ startsWith(github.ref, 'refs/tags/') }} + push: ${{ startsWith(github.ref, 'refs/tags/') } diff --git a/CHANGELOG.md b/CHANGELOG.md index e2d8601..337cb8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.17.0] - 2020-09-02 +### Added +- Add `allow-grant.sh` to main container. +- Add `db-iam-user.sh` to main container. + +### Removed +- Removed `initContainer` in favor of a single image. + ## [1.16.0] - 2020-08-31 ### Added - [Issue-165](https://github.com/ExpediaGroup/apiary-data-lake/issues/165) Add init container dockerfile for supporting air-gapped environments. diff --git a/Dockerfile b/Dockerfile index 40de11e..e586a18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,4 +79,6 @@ COPY files/update_property.py /bin/update_property.py COPY files/s3inventory.tpl /s3inventory.tpl COPY files/startup.sh /startup.sh COPY files/s3_inventory_repair.sh /s3_inventory_repair.sh +COPY files/allow-grant.sh /allow-grant.sh +COPY files/db-iam-user.sh /db-iam-user.sh CMD /startup.sh diff --git a/initContainer/allow-grant.sh b/files/allow-grant.sh old mode 100644 new mode 100755 similarity index 100% rename from initContainer/allow-grant.sh rename to files/allow-grant.sh diff --git a/initContainer/db-iam-user.sh b/files/db-iam-user.sh similarity index 100% rename from initContainer/db-iam-user.sh rename to files/db-iam-user.sh diff --git a/initContainer/Dockerfile b/initContainer/Dockerfile deleted file mode 100644 index 30f770d..0000000 --- a/initContainer/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM alpine:3.9 - -RUN apk add --no-cache mariadb-client jq -RUN addgroup -S apiary && adduser -S apiary -G apiary -H - -ADD --chown=apiary:apiary *.sh /init/ -WORKDIR /init -RUN chmod +x `ls *.sh` -USER apiary - -CMD ["/bin/sh"] diff --git a/initContainer/README.md b/initContainer/README.md deleted file mode 100644 index 8aae1ce..0000000 --- a/initContainer/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Apiary Init Container - -This container was introduced as a part of resolving [[Issue 165](https://github.com/ExpediaGroup/apiary-data-lake/issues/165)]. -The general idea of why this container exists was to remove external dependencies and networking requirements between a deployment server and the deployment target when deploying Apiary. - -Previously, Apiary had a hard requirement that the location of where the terraform apply job was running, had to have direct network access to the MySQL database in order to properly configure account access for the read-only and read-write roles. This presented some challenges when deploying into air-gapped environments as there would be no direct network access without punching a hole or proxying a connection between the deployer and the deployment environment. - -This solution relies on either [Kubernetes Init Containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) or [ECS Container dependencies](https://aws.amazon.com/about-aws/whats-new/2019/03/amazon-ecs-introduces-enhanced-container-dependency-management/), depending on your deployment target. - - -The init docker container contains the same shell scripts which were previously run as a part of the apiary terraform process. - - -## Terraform Usages - -- Kubernetes - - [Read-Only](https://github.com/ExpediaGroup/apiary-data-lake/blob/master/k8s-readonly.tf#L40) - - [Read-Write](https://github.com/ExpediaGroup/apiary-data-lake/blob/master/k8s-readwrite.tf#L40) -- ECS - - [Read-Only](https://github.com/ExpediaGroup/apiary-data-lake/blob/master/templates/apiary-hms-readonly.json#L2) - - [Read-Write](https://github.com/ExpediaGroup/apiary-data-lake/blob/master/templates/apiary-hms-readwrite.json#L2)