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

Does the workspace name of my thesis have to be "tongji-undergrad-thesis"? #12

Closed
MoyusiteruIori opened this issue Apr 13, 2024 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@MoyusiteruIori
Copy link
Contributor

I was able to compile correctly only after I renamed my workspace . It seems that envsetup.sh hardcoded WRITE_ENV as /opt/tongji-undergrad-thesis, yet this doesn't appear to be mentioned in readme.

@skyleaworlder
Copy link
Member

Really feel sorry for so late replying.

This repository has been idle for too long, and I have also forgotten some details. I just now checked the file, envsetup.sh, and indeed my WRITE_ENV is hard-coded. But it shouldn't matter because the relevant operations are all performed inside the container, and my Dockerfile specifies the workdir of the container through the WORKDIR command.

I don't know if my reply is what you expect. If not, please provide more details and I will update README.md to reduce costs.

@skyleaworlder
Copy link
Member

Actually, I was really shocked, since hardly could I believe that there are indeed someone would actually try to play around with this repo to compile the thesis template.

@MoyusiteruIori
Copy link
Contributor Author

MoyusiteruIori commented May 19, 2024

I tried again, and if the workspace name of my thesis is not tongji-undergrad-thesis, I still encounter the following error when executing the 'compile' command:

Successfully copied 344MB to c4a90df54173:/opt
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 4 Apr. 2023. Version 4.80.

------------
Latexmk: Could not find file 'main'.
-- Use the -f option to force complete processing.
Error response from daemon: Could not find the file /opt/tongji-undergrad-thesis/main.pdf in container c4a90df54173

I am just a beginner in using Docker, but here is my speculation about the possible cause of the error:

  • After executing docker compose up -d, a container is created, which includes an empty directory named /opt/tongji-undergrad-thesis. This is hard-coded in the Dockerfile.
  • In the compile function defined in envsetup.sh, the line sudo docker cp $(pwd) "${cid}:${BASE}" copies my thesis' working directory to the /opt directory of the container. At this point, the container has an additional directory /opt/my-workspace-name containing my thesis' source files. However, /opt/tongji-undergrad-thesis is still an empty directory.
  • The compile function then executes sudo docker exec -i ${cid} bash -c "cd ${WRITE_ENV} && ${COMPILE_CMD}", which enters /opt/tongji-undergrad-thesis and attempts to compile. But this directory is still empty, resulting in the error.

So this is the reason why the workspace name affects the result: If the workspace name outside the container is tongji-undergrad-thesis, then after executing docker cp, the workspace will be copied to /opt/tongji-undergrad-thesis in the container, and this directory will not be empty, so there will be no error.

@MoyusiteruIori
Copy link
Contributor Author

I have completed my graduation thesis, and I used the Docker environment provided in this repository throughout the entire process. It was very helpful to me because the free compilation time on Overleaf was not sufficient and the subscription fee was expensive. I am extremely grateful for your work. Thank you so much.

@skyleaworlder
Copy link
Member

I am really happy to be able to help you in the process of writing your thesis! I see now that when you said "workspace" you were referring to the thesis project on the host machine! Thank you for the detailed explanation, I had misunderstood before.

In that case, it makes sense because in my expectation, development is done by directly git clone https://github.com/TJ-CSCCG/tongji-undergrad-thesis/, so naturally the workspace name would be tongji-undergrad-thesis, which is indeed something I didn't handle properly.

I'll keep this issue open, and if I have the time and energy later on, I'll update for this. (And it's also open for any warm-hearted contributors to resolve!)

@skyleaworlder
Copy link
Member

Solved by #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants