Running a fork edx-platform

tutor version 13.2.2
ubuntu 21.10
i have fork the edx-platform in my github account and commit some changes like replace the logo file there now after installing tutor now i want to fork a edx-platform of my github account running the below account
tutor images build openedx
–build-arg EDX_PLATFORM_REPOSITORY=https://github.com/Harshgaur14/edx-platform.git
–build-arg EDX_PLATFORM_VERSION=open-release/maple.3
it run successfully
tutor dev quickstart

No changes are made in the platform. Why the changes are not made ?

The arg EDX_PLATFORM_VERSION=open-release/maple.3 is equvilent to the branch name. Checking your fork I see your commits are made on master thus it should be EDX_PLATFORM_VERSION=master
Hence tutor/Dockerfile at 85a44213b7f819e457d0ddb515816246578ebb94 · overhangio/tutor · GitHub

1 Like

While runnning master

tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/Harshgaur14/edx-platform.git --build-arg EDX_PLATFORM_VERSION=master

showing error

Building image docker.io/overhangio/openedx:13.2.2
docker build -t docker.io/overhangio/openedx:13.2.2 --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/Harshgaur14/edx-platform.git --build-arg EDX_PLATFORM_VERSION=master /home/cdac/.local/share/tutor/env/build/openedx
Sending build context to Docker daemon  37.89kB
Step 1/101 : FROM docker.io/ubuntu:20.04 as minimal
 ---> 53df61775e88
Step 2/101 : LABEL maintainer="Overhang.io <contact@overhang.io>"
 ---> Using cache
 ---> d120db5e308f
Step 3/101 : ENV DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> c966dff619e9
Step 4/101 : RUN apt update &&     apt install -y build-essential curl git language-pack-en
 ---> Using cache
 ---> 7d489d3d876a
Step 5/101 : ENV LC_ALL en_US.UTF-8
 ---> Using cache
 ---> 672d7c33bbd5
Step 6/101 : FROM minimal as python
 ---> 672d7c33bbd5
Step 7/101 : RUN apt update &&     apt install -y libssl-dev zlib1g-dev libbz2-dev     libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev     xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
 ---> Using cache
 ---> 4296e4e0c1fb
Step 8/101 : ARG PYTHON_VERSION=3.8.12
 ---> Using cache
 ---> 8e63b1a6084b
Step 9/101 : ENV PYENV_ROOT /opt/pyenv
 ---> Using cache
 ---> b112ad75146a
Step 10/101 : RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.2.2 --depth 1
 ---> Using cache
 ---> 35d44adea4ea
Step 11/101 : RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION
 ---> Using cache
 ---> 687b6ab78ddd
Step 12/101 : RUN $PYENV_ROOT/versions/$PYTHON_VERSION/bin/python -m venv /openedx/venv
 ---> Using cache
 ---> 8cce6bb291a0
Step 13/101 : FROM minimal as dockerize
 ---> 672d7c33bbd5
Step 14/101 : ARG DOCKERIZE_VERSION=v0.16.0
 ---> Using cache
 ---> fc2c4e90558a
Step 15/101 : RUN dockerize_url="https://github.com/powerman/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-$(uname -m | sed 's@aarch@arm@')"     && echo "Downloading dockerize from $dockerize_url"     && curl --fail --location --output /usr/local/bin/dockerize $dockerize_url     && chmod a+x /usr/local/bin/dockerize
 ---> Using cache
 ---> 793db5c5c241
Step 16/101 : FROM minimal as code
 ---> 672d7c33bbd5
Step 17/101 : ARG EDX_PLATFORM_REPOSITORY=https://github.com/openedx/edx-platform.git
 ---> Using cache
 ---> c2dce1e171c9
Step 18/101 : ARG EDX_PLATFORM_VERSION=open-release/maple.3
 ---> Using cache
 ---> 7fa449e5fc36
Step 19/101 : RUN mkdir -p /openedx/edx-platform &&     git clone $EDX_PLATFORM_REPOSITORY --branch $EDX_PLATFORM_VERSION --depth 1 /openedx/edx-platform
 ---> Using cache
 ---> 86698c3f81e3
Step 20/101 : WORKDIR /openedx/edx-platform
 ---> Using cache
 ---> 99a73f19fc78
Step 21/101 : RUN git config --global user.email "tutor@overhang.io"   && git config --global user.name "Tutor"
 ---> Using cache
 ---> 12c5300f9dbc
Step 22/101 : RUN git fetch --depth=2 https://github.com/open-craft/edx-platform/ 03731f19459e558f188c06aac5cc9ca1bbc675c2 && git cherry-pick 03731f19459e558f188c06aac5cc9ca1bbc675c2
 ---> Running in c9b49f940830
From https://github.com/open-craft/edx-platform
 * branch            03731f19459e558f188c06aac5cc9ca1bbc675c2 -> FETCH_HEAD
Auto-merging lms/djangoapps/discussion/tests/test_tasks.py
Auto-merging lms/djangoapps/discussion/tasks.py
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git cherry-pick --skip'
On branch master
Your branch is up to date with 'origin/master'.

You are currently cherry-picking commit 03731f1.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean
The command '/bin/sh -c git fetch --depth=2 https://github.com/open-craft/edx-platform/ 03731f19459e558f188c06aac5cc9ca1bbc675c2 && git cherry-pick 03731f19459e558f188c06aac5cc9ca1bbc675c2' returned a non-zero code: 1
Error: Command failed with status 1: docker build -t docker.io/overhangio/openedx:13.2.2 --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/Harshgaur14/edx-platform.git --build-arg EDX_PLATFORM_VERSION=master /home/cdac/.local/share/tutor/env/build/openedx

You are trying to run a fork of master, this will not work without further adjustments to your Tutor environment.

Please take a look here for the “proper” way of running a fork: Configuration and customisation — Tutor documentation

You should start by creating a new branch from the open-release/maple.3, eg. Harshgaur14-dev, and set EDX_PLATFORM_VERSION to Harshgaur14-dev.

Check this thread for further steps: Running an edx-platform fork from a local repository - #2 by uetuluk

1 Like

@uetuluk
i have rename the branch as harshgaur14-dev now running,

tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/Harshgaur14/edx-platform.git --build-arg EDX_PLATFORM_VERSION=harshgaur14-dev

showing

tutor images build openedx \
> --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/Harshgaur14/edx-platform.git \
> --build-arg EDX_PLATFORM_VERSION=harshgaur14-dev

I don’t think that exactly what @uetuluk meant.

If you want to add commits on top of maple then you need to checkout a new branch from open-release/maple.3 and then add the commits. this means the commit history would be: last log from open-release/maple.3 then your commits.
Here is the steps: on your fork

  • git checkout open-release/maple.3
  • git checkout -b my-new-branh / your new branch is on top of maple.3
  • Add your comits and push as usual.
    Now because you have already did your commits on master you would need rebase them with the new branch, I don’t know how to that with git. Just make sure to check your commit history. your commits should come after this commit if you are using maple.3.

@ghassanmas Thank you for the additional details.

@Harshgaur14 I created a guide for running a fork. My command examples are for MacOS, but most of them should work for Ubuntu as well.

You should particularly check this section as to why you cannot simply use the master branch.

1 Like