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

Custom MFE repo url is incorrect in README #180

Closed
FatemeKhodayari opened this issue Dec 26, 2023 · 4 comments · Fixed by #183
Closed

Custom MFE repo url is incorrect in README #180

FatemeKhodayari opened this issue Dec 26, 2023 · 4 comments · Fixed by #183
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@FatemeKhodayari
Copy link
Contributor

Hi. I recently upgraded from palm (tutor v16.1.7) to quince(tutor 17.0.0). As I have some custom MFEs, added as tutor plugins, I tried building the MFE image but I faced the following error:

 => ERROR [learning-common 1/8] COPY --from=learning-src /package.json /openedx/app/package.json                                                           0.0s
 => ERROR [learning-common 2/8] COPY --from=learning-src /package-lock.json /openedx/app/package-lock.json                                                 0.0s
------
 > [learning-common 1/8] COPY --from=learning-src /package.json /openedx/app/package.json:
------
------
 > [learning-common 2/8] COPY --from=learning-src /package-lock.json /openedx/app/package-lock.json:
------
Dockerfile:470
--------------------
 468 |     FROM base AS learning-common
 469 |     COPY --from=learning-src /package.json /openedx/app/package.json
 470 | >>> COPY --from=learning-src /package-lock.json /openedx/app/package-lock.json
 471 |     ARG NPM_REGISTRY=https://registry.npmjs.org/
 472 |     
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 26a26b81-847e-4f0a-86b0-de26d9415222::rody1bdm8rxl29aqd1wjwjypc: "/package-lock.json": not found
Error: Command failed with status 1: docker buildx build --tag=docker.io/overhangio/openedx-mfe:17.0.0 --output=type=docker --cache-from=type=registry,ref=docker.io/overhangio/openedx-mfe:17.0.0-cache /home/fateme/.local/share/tutor/env/plugins/mfe/build/mfe

As I have both package.json and package-lock.json in my repository, I took a look at the MFE Dockerfile, where this line (the git clone stage) caught my eye:

ADD --keep-git-dir=true https://github.com/openedx/frontend-app-learning.git#open-release/quince.1 .

The line above is what originally exists in the dockerfile of v17.0.0 but as you add custom MFEs, this line gets changed to something like this:

ADD --keep-git-dir=true https://github.com/openedx/frontend-app-learning/#<custom-branch-or-tag> .

The difference is that, as the readme says as well, people have used their repository URL in the plugin, so no .git exists at the end of the repository key of the MFE plugin, making this line to fail and the mentioned error to occur.

The script looked like this before this change:

RUN git clone {{ app["repository"] }} --branch {{ app.get("version", MFE_COMMON_VERSION) }} --depth 1 .

So shall we change the readme and ask for URLs with .git or shall we fix the script?

@regisb regisb added the documentation Improvements or additions to documentation label Jan 8, 2024
@regisb regisb added the good first issue Good for newcomers label Jan 8, 2024
@regisb
Copy link
Contributor

regisb commented Jan 8, 2024

Very good point. Yes, we should update the README such that repo URLs include a ".git" suffix. Would you like to open a PR?

@FatemeKhodayari
Copy link
Contributor Author

Very good point. Yes, we should update the README such that repo URLs include a ".git" suffix. Would you like to open a PR?

Done. Also while doing the PR, I found this PR and this forum topic. Wish I'd seen them sooner :))

@regisb regisb changed the title Custom MFE build fails Custom MFE repo url is incorrect in README Jan 9, 2024
@Abdul-Muqadim-Arbisoft Abdul-Muqadim-Arbisoft moved this from Backlog to In review in Tutor project management Jan 10, 2024
@Abdul-Muqadim-Arbisoft Abdul-Muqadim-Arbisoft removed their assignment Jan 16, 2024
@waza-ari
Copy link
Contributor

Thanks for figuring this out, I was banging my head against the wall for the past couple of hours. @regisb, would it be possible to add this to the Release Notes here on GitHub? I was going through them and didn't find anything relevant.

@github-project-automation github-project-automation bot moved this from In review to Done in Tutor project management Jan 22, 2024
@regisb
Copy link
Contributor

regisb commented Jan 22, 2024

@waza-ari sure thing https://github.com/overhangio/tutor-mfe/releases/tag/v17.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
4 participants