Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add nutmeg release support #18

Merged
merged 1 commit into from
May 30, 2022
Merged

feat: add nutmeg release support #18

merged 1 commit into from
May 30, 2022

Conversation

mariajgrimaldi
Copy link
Member

@mariajgrimaldi mariajgrimaldi commented May 18, 2022

Description

This PR adds nutmeg support:

  • Update references from Maple to Nutmeg release
  • Update AppArmor profile so it uses python > 3 (see ref)

How to test

Steps to reproduce the behavior:

  1. Install tutor, tutor-contrib-codejail, codejailservice from source
  2. Move to nutmeg branches: nutmeg -for tutor-, 14.0.0 -for codejailservice-, MJG/nutmeg -for tutor-contrib-codejail-
  3. Install plugin
  4. Build images: tutor config save && tutor images build all
  5. Init services: tutor dev init
  6. Follow test instructions here. The error will appear in the course component.

@@ -51,9 +51,8 @@ WORKDIR /var/tmp
RUN mkdir -p common/lib/

COPY --from={{ DOCKER_IMAGE_OPENEDX }} /openedx/edx-platform/common/lib/sandbox-packages common/lib/sandbox-packages
COPY --from={{ DOCKER_IMAGE_OPENEDX }} /openedx/edx-platform/common/lib/symmath common/lib/symmath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need symmath anymore? or is it included in py38?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

Now that it is located at openedx-calc

Symmath has been added to openedx-calc alongside calc in openedx/openedx-calc#38.

Do we need to allow it or install it or something else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said, it's now in py38.txt

@@ -17,7 +17,7 @@
"VERSION": __version__,
"HOST": "codejailservice",
"DOCKER_IMAGE": f"docker.io/ednxops/codejailservice:{__version__}",
"SANDBOX_PYTHON_VERSION": "3.5.10",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We changed it from 3.5 to 3.8 since the sandbox requirements didn't include py3.5 anymore.
Now, which patch version should we use here?
We first tried to use 3.8.6 but then changed it to 3.8.5 so it doesn't crash with the codejailservice pyenv (which also uses 3.8.6).
@felipemontoya @Alec4r @MoisesGSalas @jfavellar90 @johanv26

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can use pyenv-alias and install the sandbox version as x.y.z_sandbox ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great suggestion! Thanks, I'll try that



#
# Whitelist particiclar shared objects from the system
# python installation
#
/sandbox/venv/** mr,
/opt/pyenv/versions/3.5.10/** mr,
/opt/pyenv/versions/3.[0-9].*/** mr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this intended for the sandbox version only? you can use {{ SANDBOX_PYTHON_VERSION }} right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right! Thanks

@mariajgrimaldi
Copy link
Member Author

Can you review again please? @MoisesGSalas @felipemontoya



#
# Whitelist particiclar shared objects from the system
# python installation
#
/sandbox/venv/** mr,
/opt/pyenv/versions/3.5.10/** mr,
/opt/pyenv/versions/{{ CODEJAIL_SANDBOX_PYTHON_VERSION }}/** mr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be {{ CODEJAIL_SANDBOX_PYTHON_VERSION }}_sandbox

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally missed that. Thanks

@@ -20,7 +20,8 @@ ARG CODEJAILSERVICE_PYTHON_VERSION=3.8.6
RUN $PYENV_ROOT/bin/pyenv install $CODEJAILSERVICE_PYTHON_VERSION

ARG SANDBOX_PYTHON_VERSION={{ CODEJAIL_SANDBOX_PYTHON_VERSION }}
RUN $PYENV_ROOT/bin/pyenv install $SANDBOX_PYTHON_VERSION
RUN git clone https://github.com/s1341/pyenv-alias.git $PYENV_ROOT/plugins/pyenv-alias
RUN VERSION_ALIAS={{ CODEJAIL_SANDBOX_PYTHON_VERSION }}_sandbox $PYENV_ROOT/bin/pyenv install $SANDBOX_PYTHON_VERSION

RUN $PYENV_ROOT/versions/$CODEJAILSERVICE_PYTHON_VERSION/bin/python -m venv /openedx/venv
RUN $PYENV_ROOT/versions/$SANDBOX_PYTHON_VERSION/bin/python -m venv --copies /sandbox/venv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUN $PYENV_ROOT/versions/$SANDBOX_PYTHON_VERSION/bin/python -m venv --copies /sandbox/venv
RUN $PYENV_ROOT/versions/"$SANDBOX_PYTHON_VERSION"_sandbox/bin/python -m venv --copies /sandbox/venv

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, thanks. I'll build the image and let you know how it goes

@DeanJayMathew
Copy link

DeanJayMathew commented May 28, 2022

@mariajgrimaldi Has this fix been successful?

The reason I ask is because it is a blocker to resolving this Nutmeg testing issue: openedx/wg-build-test-release#159

@mariajgrimaldi
Copy link
Member Author

Yes @DeanJayMathew. I'm just waiting for an approval to merge and release.

@mariajgrimaldi
Copy link
Member Author

I've tested building a new image with the latest changes in the PR and it's working!
image
image

Using the course attached here

* Bump version 13.x to 14.x
* Bump Python to 3.8 in sandbox environment
* Add support for python 3.8 in the apparmor profile
@mariajgrimaldi mariajgrimaldi deleted the MJG/nutmeg branch May 30, 2022 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants