From 400511f465e1abc83a02cc807f3e85906a087095 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:15:44 +0500 Subject: [PATCH] chore: removed dockerfile & workflow file --- .dockerignore | 1 - .github/docker-compose-github.yml | 44 ----------- .github/workflows/push-docker-images.yml | 48 ------------ Dockerfile | 96 ------------------------ 4 files changed, 189 deletions(-) delete mode 100644 .dockerignore delete mode 100644 .github/docker-compose-github.yml delete mode 100644 .github/workflows/push-docker-images.yml delete mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 94143827e..000000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -Dockerfile diff --git a/.github/docker-compose-github.yml b/.github/docker-compose-github.yml deleted file mode 100644 index 88496643d..000000000 --- a/.github/docker-compose-github.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: "2.1" - -services: - es: - image: elasticsearch:1.5.2 - analyticsapi: - image: edxops/analytics_api:${DATA_API_VERSION:-latest} - container_name: analytics_api - environment: - ELASTICSEARCH_LEARNERS_HOST: 'http://es:9200/' - ELASTICSEARCH_LEARNERS_INDEX: 'learner' - ELASTICSEARCH_LEARNERS_UPDATE_INDEX: 'index_update' - command: /edx/app/analytics_api/venvs/analytics_api/bin/python /edx/app/analytics_api/analytics_api/manage.py runserver 0.0.0.0:80 --settings analyticsdataserver.settings.local - insights: - # Use this image once the Python version upgrade is complete - # image: edxops/insights:latest - build: - context: ../. - target: dev - args: - PYTHON_VERSION: "${PYTHON_VERSION}" - container_name: insights_testing - volumes: - - ..:/edx/app/insights/edx_analytics_dashboard - command: tail -f /dev/null - environment: - # Pull these from the host environment. - DATADOG_API_KEY: - # Rest of the environment variables for testing. - API_SERVER_URL: http://analyticsapi/api/v0 - API_AUTH_TOKEN: edx - LMS_HOSTNAME: lms - LMS_PASSWORD: pass - LMS_USERNAME: user - ENABLE_AUTO_AUTH: "True" - ENABLE_OAUTH_TESTS: "False" - ENABLE_ERROR_PAGE_TESTS: "False" - DISPLAY_LEARNER_ANALYTICS: "True" - ENABLE_COURSE_LIST_FILTERS: "True" - ENABLE_COURSE_LIST_PASSING: "True" - SELENIUM_BROWSER: "firefox" - depends_on: - - "es" - - "analyticsapi" diff --git a/.github/workflows/push-docker-images.yml b/.github/workflows/push-docker-images.yml deleted file mode 100644 index 8e0c3be94..000000000 --- a/.github/workflows/push-docker-images.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build and Push Docker Images - -on: - push: - branches: - - master - - open-release/** -jobs: - push: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - # Use the release name as the image tag if we're building an open release branch. - # Examples: if we're building 'open-release/maple.master', tag the image as 'maple.master'. - # Otherwise, we must be building from a push to master, so use 'latest'. - - name: Get tag name - id: get-tag-name - uses: actions/github-script@v5 - with: - script: | - const branchName = context.ref.split('/').slice(-1)[0]; - const tagName = branchName === 'master' ? 'latest' : branchName; - console.log('Will use tag: ' + tagName); - return tagName; - result-encoding: string - - - name: Build and push Dev Docker image - uses: docker/build-push-action@v1 - with: - push: true - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - target: dev - repository: edxops/insights-dev - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} - - # - name: Build and push prod Docker image - # uses: docker/build-push-action@v1 - # with: - # push: true - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_PASSWORD }} - # target: prod - # repository: edxops/insights - # tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 80f7b753d..000000000 --- a/Dockerfile +++ /dev/null @@ -1,96 +0,0 @@ -FROM ubuntu:focal as app - -ENV DEBIAN_FRONTEND noninteractive - -ARG PYTHON_VERSION=3.8 - -# Packages installed: - -# pkg-config; mysqlclient>=2.2.0 requires pkg-config (https://github.com/PyMySQL/mysqlclient/issues/620) - -RUN apt-get update && \ - apt-get install -y software-properties-common && \ - apt-add-repository -y ppa:deadsnakes/ppa && \ - apt-get install --no-install-recommends -qy \ - language-pack-en \ - build-essential \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-distutils \ - libmysqlclient-dev \ - pkg-config \ - libssl-dev \ - # needed by phantomjs - libfontconfig \ - # needed by i18n tests in CI - gettext \ - # needed by a11y tests script - curl \ - # needed to install github based dependency - git && \ - 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 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_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}" - -RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} -RUN pip install virtualenv - -# No need to activate insights virtualenv as it is already activated by putting in the path -RUN virtualenv -p python${PYTHON_VERSION} --always-copy ${INSIGHTS_VENV_DIR} - -COPY requirements ${INSIGHTS_CODE_DIR}/requirements - -ENV PATH="${INSIGHTS_CODE_DIR}/node_modules/.bin:$PATH" - -WORKDIR ${INSIGHTS_CODE_DIR}/ - -# insights service config commands below -RUN pip install --no-cache-dir -r ${INSIGHTS_CODE_DIR}/requirements/production.txt - -RUN nodeenv ${INSIGHTS_NODEENV_DIR} --node=18.20.2 --prebuilt \ - && npm install -g npm@10.5.x - -# Tried to cache the dependencies by copying related files after the npm install step but npm post install fails in that case. -COPY . ${INSIGHTS_CODE_DIR}/ -RUN npm set progress=false && npm ci - -EXPOSE 8110 -EXPOSE 18110 - -FROM app as dev - -RUN pip install --no-cache-dir -r requirements/local.txt - -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 - -ENV DJANGO_SETTINGS_MODULE "analytics_dashboard.settings.production" - -CMD gunicorn \ - --pythonpath=/edx/app/insights/edx_analytics_dashboard/analytics_dashboard \ - --timeout=300 \ - -b 0.0.0.0:8110 \ - -w 2 \ - - analytics_dashboard.wsgi:application