From 88e91f05aa780ab351190b6a17758f7db2d044a0 Mon Sep 17 00:00:00 2001 From: zubairshakoorarbisoft Date: Thu, 10 Aug 2023 19:50:47 +0500 Subject: [PATCH 1/2] fix: removed devpi related references from build and playbooks --- docker/build/devpi/Dockerfile | 45 ------------------ docker/build/devpi/docker-entrypoint.sh | 36 -------------- docker/build/notes/Dockerfile | 18 ++++++- docker/plays/devpi.yml | 11 ----- playbooks/roles/devpi/defaults/main.yml | 33 ------------- playbooks/roles/devpi/tasks/main.yml | 63 ------------------------- util/parsefiles_config.yml | 1 - 7 files changed, 17 insertions(+), 190 deletions(-) delete mode 100644 docker/build/devpi/Dockerfile delete mode 100644 docker/build/devpi/docker-entrypoint.sh delete mode 100644 docker/plays/devpi.yml delete mode 100644 playbooks/roles/devpi/defaults/main.yml delete mode 100644 playbooks/roles/devpi/tasks/main.yml diff --git a/docker/build/devpi/Dockerfile b/docker/build/devpi/Dockerfile deleted file mode 100644 index fd26af44d9e..00000000000 --- a/docker/build/devpi/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# To build this Dockerfile: -# -# From the root of configuration: -# -# docker build -f docker/build/devpi/Dockerfile . -# -# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible -# with the currently checked-out configuration repo. - -ARG BASE_IMAGE_TAG=latest -FROM edxops/focal-common:${BASE_IMAGE_TAG} -LABEL maintainer="edxops" - -ARG ARG_DEVPI_SERVER_VERSION=6.3.1 -ARG ARG_DEVPI_WEB_VERSION=4.0.8 -ARG ARG_DEVPI_CLIENT_VERSION=5.2.3 - -ADD . /edx/app/edx_ansible/edx_ansible - -WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays - -RUN apt-get update - -COPY docker/devstack_common_ansible_overrides.yml /devstack/ansible_overrides.yml - -RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook devpi.yml \ - -c local -i '127.0.0.1,' \ - -t "install,devstack" \ - --extra-vars="@/devstack/ansible_overrides.yml" \ - --extra-vars="DEVPI_SERVER_VERSION=$ARG_DEVPI_SERVER_VERSION" \ - --extra-vars="DEVPI_WEB_VERSION=$ARG_DEVPI_WEB_VERSION" \ - --extra-vars="DEVPI_CLIENT_VERSION=$ARG_DEVPI_CLIENT_VERSION" - -EXPOSE 3141 -VOLUME /data - -COPY docker/build/devpi/docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod +x /docker-entrypoint.sh - -USER root -ENV HOME /data -WORKDIR /data - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["devpi"] diff --git a/docker/build/devpi/docker-entrypoint.sh b/docker/build/devpi/docker-entrypoint.sh deleted file mode 100644 index 83a360c4223..00000000000 --- a/docker/build/devpi/docker-entrypoint.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -function defaults { - : ${DEVPISERVER_SERVERDIR="/data/server"} - : ${DEVPI_CLIENTDIR="/data/client"} - - echo "DEVPISERVER_SERVERDIR is ${DEVPISERVER_SERVERDIR}" - echo "DEVPI_CLIENTDIR is ${DEVPI_CLIENTDIR}" - - export DEVPISERVER_SERVERDIR DEVPI_CLIENTDIR -} - -function initialize_devpi { - echo "[RUN]: Initializing devpi-server..." - DEVPI_PASSWORD=`date +%s | sha256sum | base64 | head -c 32` - devpi-init --root-passwd ${DEVPI_PASSWORD} - echo "[RUN]: devpi-server password set to '${DEVPI_PASSWORD}'" > $DEVPISERVER_SERVERDIR/.serverpassword -} - -defaults - -if [ "$1" = 'devpi' ]; then - source /home/devpi/venvs/devpi_venv/bin/activate - - if [ ! -f $DEVPISERVER_SERVERDIR/.serverversion ]; then - initialize_devpi - fi - - echo "[RUN]: Launching devpi-server..." - exec devpi-server --restrict-modify root --host 0.0.0.0 --port 3141 -fi - -echo "[RUN]: Builtin command not provided [devpi]" -echo "[RUN]: $@" - -exec "$@" diff --git a/docker/build/notes/Dockerfile b/docker/build/notes/Dockerfile index 66619362211..a0fc6742155 100644 --- a/docker/build/notes/Dockerfile +++ b/docker/build/notes/Dockerfile @@ -16,6 +16,9 @@ ENV OPENEDX_RELEASE=${OPENEDX_RELEASE} ENV NOTES_VERSION=${OPENEDX_RELEASE} ENV REPO_OWNER=edx + +ENV EDX_NOTES_API_VENV="/edx/edx_notes_api/venvs/edx_notes_api" + ADD . /edx/app/edx_ansible/edx_ansible WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays @@ -24,7 +27,20 @@ COPY docker/build/notes/ansible_overrides.yml / COPY docker/build/notes/edx_notes_api.yml /edx/etc/edx_notes_api.yml -RUN sudo apt-get update && sudo apt-get -y install python3-dev libmysqlclient-dev +# Ansible Free work start +RUN sudo apt-get update && sudo apt-get -y install python3-dev libmysqlclient-dev python3-virtualenv python3-pip +RUN apt-get install -y sudo + + + +RUN pip install -r /edx/edx_notes_api/edx_notes_api/requirements/base.txt + + +# Ansible Free work end + + + + RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook notes.yml \ -c local -i '127.0.0.1,' \ diff --git a/docker/plays/devpi.yml b/docker/plays/devpi.yml deleted file mode 100644 index f05210ec798..00000000000 --- a/docker/plays/devpi.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Usage: ansible-playbook devpi.yml -i , -e /admin/edx_admin.yml -e /admin/admin.yml -- name: Configure instance(s) - hosts: all - become: True - gather_facts: True - vars: - serial_count: 1 - serial: "{{ serial_count }}" - roles: - - common - - devpi diff --git a/playbooks/roles/devpi/defaults/main.yml b/playbooks/roles/devpi/defaults/main.yml deleted file mode 100644 index 367d59d3f85..00000000000 --- a/playbooks/roles/devpi/defaults/main.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# -# edX Configuration -# -# github: https://github.com/openedx/configuration -# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS -# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions -# license: https://github.com/openedx/configuration/blob/master/LICENSE.TXT -# -## -# Defaults for role devpi - -devpi_group: devpi -devpi_user: devpi -devpi_app_dir: /home/devpi -devpi_venv_dir: devpi_venv -devpi_venv_path: "{{ devpi_app_dir }}/venvs/{{ devpi_venv_dir }}" - -devpi_environment: - PIP_NO_CACHE_DIR: "off" - PIP_INDEX_URL: "https://pypi.python.org/simple" - PIP_TRUSTED_HOST: "127.0.0.1" - VIRTUAL_ENV: "{{ devpi_venv_path }}" - PATH: $VIRTUAL_ENV/bin:$PATH - -# The versions below are required to be passed-in to the role. -DEVPI_REQUIREMENTS: - - name: devpi-server - version: "{{ DEVPI_SERVER_VERSION }}" - - name: devpi-web - version: "{{ DEVPI_WEB_VERSION }}" - - name: devpi-client - version: "{{ DEVPI_CLIENT_VERSION }}" diff --git a/playbooks/roles/devpi/tasks/main.yml b/playbooks/roles/devpi/tasks/main.yml deleted file mode 100644 index 2396cd95927..00000000000 --- a/playbooks/roles/devpi/tasks/main.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -# -# edX Configuration -# -# github: https://github.com/openedx/configuration -# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS -# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions -# license: https://github.com/openedx/configuration/blob/master/LICENSE.TXT -# -# -# -# Tasks for role devpi -# -# Overview: -# -# -# Dependencies: -# -# -# Example play: -# -# - -- name: Create the application group - group: - name: "{{ devpi_group }}" - state: present - tags: - - "install" - -- name: Create application user - user: - name: "{{ devpi_user }}" - home: "{{ devpi_app_dir }}" - group: "{{ devpi_group }}" - createhome: no - shell: /bin/false - tags: - - "install" - -- name: Create devpi user dirs - file: - path: "{{ item }}" - state: directory - owner: "{{ devpi_user }}" - group: "{{ devpi_group }}" - with_items: - - "{{ devpi_app_dir }}" - - "{{ devpi_venv_dir }}" - tags: - - "install" - -- name: install python requirements - pip: - name: "{{ item.name }}" - version: "{{ item.version|default(omit) }}" - extra_args: "--exists-action w {{ item.extra_args|default('') }}" - virtualenv: "{{ devpi_venv_path }}" - state: present - with_items: "{{ DEVPI_REQUIREMENTS }}" - become_user: "{{ devpi_user }}" - tags: - - "install" diff --git a/util/parsefiles_config.yml b/util/parsefiles_config.yml index 7b83943242d..99c6ed93aab 100644 --- a/util/parsefiles_config.yml +++ b/util/parsefiles_config.yml @@ -32,7 +32,6 @@ weights: - ecomworker: 4 - notes: 2 - mongo: 1 - - devpi: 1 - analytics_pipeline: 8 - analytics_pipeline_hadoop_datanode: 2 - analytics_pipeline_hadoop_namenode: 3 From c285cb9a1b4bb7dcd41ff9e0c40cf4bff6b19461 Mon Sep 17 00:00:00 2001 From: zubairshakoorarbisoft Date: Tue, 15 Aug 2023 13:35:41 +0500 Subject: [PATCH 2/2] fix: devpi_consumer role has been removed froom configuratioon as well. --- docker/build/notes/Dockerfile | 18 +-------------- docker/plays/ecommerce.yml | 1 - docker/plays/edxapp.yml | 1 - .../roles/devpi_consumer/defaults/main.yml | 20 ----------------- playbooks/roles/devpi_consumer/tasks/main.yml | 22 ------------------- .../devpi_consumer/templates/pip.conf.j2 | 11 ---------- 6 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 playbooks/roles/devpi_consumer/defaults/main.yml delete mode 100644 playbooks/roles/devpi_consumer/tasks/main.yml delete mode 100644 playbooks/roles/devpi_consumer/templates/pip.conf.j2 diff --git a/docker/build/notes/Dockerfile b/docker/build/notes/Dockerfile index a0fc6742155..66619362211 100644 --- a/docker/build/notes/Dockerfile +++ b/docker/build/notes/Dockerfile @@ -16,9 +16,6 @@ ENV OPENEDX_RELEASE=${OPENEDX_RELEASE} ENV NOTES_VERSION=${OPENEDX_RELEASE} ENV REPO_OWNER=edx - -ENV EDX_NOTES_API_VENV="/edx/edx_notes_api/venvs/edx_notes_api" - ADD . /edx/app/edx_ansible/edx_ansible WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays @@ -27,20 +24,7 @@ COPY docker/build/notes/ansible_overrides.yml / COPY docker/build/notes/edx_notes_api.yml /edx/etc/edx_notes_api.yml -# Ansible Free work start -RUN sudo apt-get update && sudo apt-get -y install python3-dev libmysqlclient-dev python3-virtualenv python3-pip -RUN apt-get install -y sudo - - - -RUN pip install -r /edx/edx_notes_api/edx_notes_api/requirements/base.txt - - -# Ansible Free work end - - - - +RUN sudo apt-get update && sudo apt-get -y install python3-dev libmysqlclient-dev RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook notes.yml \ -c local -i '127.0.0.1,' \ diff --git a/docker/plays/ecommerce.yml b/docker/plays/ecommerce.yml index 14987139153..ef06356805a 100644 --- a/docker/plays/ecommerce.yml +++ b/docker/plays/ecommerce.yml @@ -6,7 +6,6 @@ serial_count: 1 serial: "{{ serial_count }}" roles: - - devpi_consumer - ecommerce - sqlite_fix - browsers diff --git a/docker/plays/edxapp.yml b/docker/plays/edxapp.yml index ccdc314f9f9..a1504d907dc 100644 --- a/docker/plays/edxapp.yml +++ b/docker/plays/edxapp.yml @@ -7,5 +7,4 @@ serial: "{{ serial_count }}" roles: - common - - devpi_consumer - edxapp diff --git a/playbooks/roles/devpi_consumer/defaults/main.yml b/playbooks/roles/devpi_consumer/defaults/main.yml deleted file mode 100644 index 32295557579..00000000000 --- a/playbooks/roles/devpi_consumer/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Variables for the devpi_consumer role -# This role allows a host to use the configured devpi server as a primary source for pip -# Defaults are for Docker Devstack -# - -# This should be a directory, pip.conf will be appended -DEVPI_PIP_CONF_PATH: /root/.pip -DEVPI_PIP_CONF_OWNER: root -DEVPI_PIP_CONF_GROUP: root - -DEVPI_HOST: edx.devstack.devpi -DEVPI_PORT: 3141 - -# http or https -# -DEVPI_PROTOCOL: http - -# Use a leading slash, but no trailing slash here -# -DEVPI_INDEX: /root/pypi diff --git a/playbooks/roles/devpi_consumer/tasks/main.yml b/playbooks/roles/devpi_consumer/tasks/main.yml deleted file mode 100644 index 83a4633d0d9..00000000000 --- a/playbooks/roles/devpi_consumer/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: create pip conf directory - file: - path: "{{ DEVPI_PIP_CONF_PATH }}" - state: directory - owner: "{{ DEVPI_PIP_CONF_OWNER }}" - group: "{{ DEVPI_PIP_CONF_GROUP }}" - when: devstack is defined and devstack - tags: - - devstack - - devstack:install - -- name: write pip.conf to devstack - template: - src: "pip.conf.j2" - dest: "{{ DEVPI_PIP_CONF_PATH }}/pip.conf" - owner: "{{ DEVPI_PIP_CONF_OWNER }}" - group: "{{ DEVPI_PIP_CONF_GROUP }}" - mode: 0744 - when: devstack is defined and devstack - tags: - - devstack - - devstack:install diff --git a/playbooks/roles/devpi_consumer/templates/pip.conf.j2 b/playbooks/roles/devpi_consumer/templates/pip.conf.j2 deleted file mode 100644 index 15bd7bb9025..00000000000 --- a/playbooks/roles/devpi_consumer/templates/pip.conf.j2 +++ /dev/null @@ -1,11 +0,0 @@ -[global] -index-url = {{ DEVPI_PROTOCOL }}://{{ DEVPI_HOST }}:{{ DEVPI_PORT }}{{ DEVPI_INDEX }}/+simple/ - -# Enables failover to PyPI if devpi is broken -extra-index-url = https://pypi.python.org/simple - -# This is necessary if you aren't using TLS on the DevPI host -trusted-host = {{ DEVPI_HOST }} - -[search] -index = {{ DEVPI_PROTOCOL }}://{{ DEVPI_HOST }}:{{ DEVPI_PORT }}{{ DEVPI_INDEX }}/