-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into huniafatima/consolidate-image-publish-workflows
- Loading branch information
Showing
21 changed files
with
341 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build and Push License Manager Image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "Target branch from which the source dockerfile from image will be sourced" | ||
|
||
schedule: | ||
- cron: "0 4 * * 1-5" # UTC Time | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Get tag name | ||
id: get-tag-name | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
const tagName = "${{ github.event.inputs.branch }}" || 'latest'; | ||
console.log('Will use tag: ' + tagName); | ||
return tagName; | ||
result-encoding: string | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push Dev Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: ./dockerfiles/license-manager.Dockerfile | ||
push: true | ||
target: app | ||
tags: edxops/license-manager-dev:${{ steps.get-tag-name.outputs.result }} | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
# Commenting the notification section temporarily as we don't have the owning team email for titans yet. | ||
# - name: Send failure notification | ||
# if: failure() | ||
# uses: dawidd6/action-send-mail@v3 | ||
# with: | ||
# server_address: email-smtp.us-east-1.amazonaws.com | ||
# server_port: 465 | ||
# username: ${{secrets.edx_smtp_username}} | ||
# password: ${{secrets.edx_smtp_password}} | ||
# subject: Push Image to docker.io/edxops failed in License Manager Coordinator | ||
# to: [email protected] | ||
# from: github-actions <[email protected]> | ||
# body: Push Image to docker.io/edxops for License Manager Coordinator failed! For details see "github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:focal as app | ||
FROM ubuntu:focal AS app | ||
MAINTAINER [email protected] | ||
|
||
|
||
|
@@ -37,11 +37,11 @@ RUN rm -rf /var/lib/apt/lists/* | |
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US:en | ||
ENV LC_ALL=en_US.UTF-8 | ||
|
||
ENV DJANGO_SETTINGS_MODULE commerce_coordinator.settings.production | ||
ENV DJANGO_SETTINGS_MODULE=commerce_coordinator.settings.production | ||
|
||
EXPOSE 8140 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:focal as base | ||
FROM ubuntu:focal AS base | ||
|
||
# System requirements | ||
# - git; Used to pull in particular requirements from github rather than pypi, | ||
|
@@ -35,12 +35,12 @@ ENV PATH="$NODE_ENV/bin:$PATH" | |
RUN npm install -g [email protected] | ||
|
||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV DJANGO_SETTINGS_MODULE credentials.settings.production | ||
ENV OPENEDX_ATLAS_PULL true | ||
ENV CREDENTIALS_CFG "minimal.yml" | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US:en | ||
ENV LC_ALL=en_US.UTF-8 | ||
ENV DJANGO_SETTINGS_MODULE=credentials.settings.production | ||
ENV OPENEDX_ATLAS_PULL=true | ||
ENV CREDENTIALS_CFG="minimal.yml" | ||
|
||
EXPOSE 18150 | ||
RUN useradd -m --shell /bin/false app | ||
|
@@ -94,8 +94,11 @@ CMD gunicorn --workers=2 --name credentials -c /edx/app/credentials/credentials/ | |
|
||
# We don't switch back to the app user for devstack because we need devstack users to be | ||
# able to update requirements and generally run things as root. | ||
FROM base as dev | ||
FROM base AS dev | ||
USER root | ||
|
||
RUN curl -L -o credentials/settings/devstack.py https://raw.githubusercontent.com/edx/devstack/master/py_configuration_files/credentials.py | ||
|
||
ENV DJANGO_SETTINGS_MODULE credentials.settings.devstack | ||
RUN pip install -r /edx/app/credentials/credentials/requirements/dev.txt | ||
RUN make pull_translations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM ubuntu:focal as app | ||
FROM ubuntu:focal AS app | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG PYTHON_VERSION=3.8 | ||
|
||
|
@@ -30,23 +30,23 @@ RUN apt-get update && \ | |
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US:en | ||
ENV LC_ALL=en_US.UTF-8 | ||
|
||
# ENV variables lifetime is bound to the container whereas ARGS variables lifetime is bound to the image building process only | ||
# Also ARGS provide us an option of compatibility of Path structure for Tutor and other OpenedX installations | ||
ARG COMMON_CFG_DIR "/edx/etc" | ||
ARG COMMON_CFG_DIR="/edx/etc" | ||
ARG COMMON_APP_DIR="/edx/app" | ||
ARG INSIGHTS_APP_DIR="${COMMON_APP_DIR}/insights" | ||
ARG INSIGHTS_VENV_DIR="${COMMON_APP_DIR}/insights/venvs/insights" | ||
ARG INSIGHTS_CODE_DIR="${INSIGHTS_APP_DIR}/edx_analytics_dashboard" | ||
ARG INSIGHTS_NODEENV_DIR="${COMMON_APP_DIR}/insights/nodeenvs/insights" | ||
|
||
ENV PATH "${INSIGHTS_VENV_DIR}/bin:${INSIGHTS_NODEENV_DIR}/bin:$PATH" | ||
ENV INSIGHTS_APP_DIR ${INSIGHTS_APP_DIR} | ||
ENV THEME_SCSS "sass/themes/open-edx.scss" | ||
ENV PYTHON_VERSION "${PYTHON_VERSION}" | ||
ENV PATH="${INSIGHTS_VENV_DIR}/bin:${INSIGHTS_NODEENV_DIR}/bin:$PATH" | ||
ENV INSIGHTS_APP_DIR=${INSIGHTS_APP_DIR} | ||
ENV THEME_SCSS="sass/themes/open-edx.scss" | ||
ENV PYTHON_VERSION="${PYTHON_VERSION}" | ||
|
||
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} | ||
RUN pip install virtualenv | ||
|
@@ -67,6 +67,8 @@ RUN pip install --no-cache-dir -r requirements/production.txt | |
|
||
RUN curl -L https://github.com/edx/edx-analytics-dashboard/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1 | ||
|
||
RUN curl -L -o ${INSIGHTS_CODE_DIR}/analytics_dashboard/settings/devstack.py https://raw.githubusercontent.com/edx/devstack/master/py_configuration_files/course-discovery.py | ||
|
||
RUN nodeenv ${INSIGHTS_NODEENV_DIR} --node=18.20.2 --prebuilt \ | ||
&& npm install -g [email protected] | ||
|
||
|
@@ -75,20 +77,20 @@ RUN npm set progress=false && npm ci | |
EXPOSE 8110 | ||
EXPOSE 18110 | ||
|
||
FROM app as dev | ||
FROM app AS dev | ||
|
||
RUN pip install --no-cache-dir -r requirements/local.txt | ||
|
||
ENV DJANGO_SETTINGS_MODULE "analytics_dashboard.settings.devstack" | ||
ENV DJANGO_SETTINGS_MODULE="analytics_dashboard.settings.devstack" | ||
|
||
# Backwards compatibility with devstack | ||
RUN touch "${INSIGHTS_APP_DIR}/insights_env" | ||
|
||
CMD while true; do python ./manage.py runserver 0.0.0.0:8110; sleep 2; done | ||
|
||
FROM app as prod | ||
FROM app AS prod | ||
|
||
ENV DJANGO_SETTINGS_MODULE "analytics_dashboard.settings.production" | ||
ENV DJANGO_SETTINGS_MODULE="analytics_dashboard.settings.production" | ||
|
||
CMD gunicorn \ | ||
--pythonpath=/edx/app/insights/edx_analytics_dashboard/analytics_dashboard \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:focal as app | ||
FROM ubuntu:focal AS app | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
|
||
|
Oops, something went wrong.