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

✨ Add docker container for building #12

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

✨ Add docker container for building #12

wants to merge 2 commits into from

Conversation

Tieske
Copy link
Contributor

@Tieske Tieske commented Dec 7, 2023

attempt to do site generation in a docker container

@Tieske
Copy link
Contributor Author

Tieske commented Dec 7, 2023

Doesn't work due to Python/Pip error: Getting requirements to build wheel did not run successfully

@Thalhammer
Copy link
Member

@Tieske Can you check if this now works for you ?

@Thalhammer Thalhammer changed the title add docker container ✨ Add docker container for building Jun 30, 2024
@Tieske
Copy link
Contributor Author

Tieske commented Jul 1, 2024

Got a permissions error, than reran with --user root. Now hitting this:

tieskes-mbp:homieiot.github.io thijs$ docker run --rm -v $PWD:/work homie-site:dev
/work/./grabrepos.py:26: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  content = yaml.load(stream)
Wrote file: /work/content/specification/preface/spec-core-develop.md
Wrote file: /work/content/specification/spec-core-develop.md
Wrote file: /work/content/specification/spec-core-v1_5_0.md
Wrote file: /work/content/specification/spec-core-v2_0_0.md
Wrote file: /work/content/specification/spec-core-v2_0_1.md
Wrote file: /work/content/specification/spec-core-v3_0_0.md
Wrote file: /work/content/specification/spec-core-v3_0_1.md
Traceback (most recent call last):
  File "/work/./grabrepos.py", line 232, in <module>
    checkout_repo(targetdir, entry['name'], entry['repo'], entry['filepattern'],checkoutdir, entry['keepsections'], update_repos)
  File "/work/./grabrepos.py", line 174, in checkout_repo
    repo.head.reset(index=True, working_tree=True)
  File "/usr/local/lib/python3.12/site-packages/git/refs/head.py", line 104, in reset
    self.repo.git.reset(mode, commit, "--", paths, **kwargs)
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 741, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 1315, in _call_process
    return self.execute(call, **exec_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 1109, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git reset --hard HEAD --
  stderr: 'error: unable to unlink old 'readme.md': No such file or directory
fatal: Could not reset index file to revision 'HEAD'.'
tieskes-mbp:homieiot.github.io thijs$```

@Thalhammer
Copy link
Member

This is kinda weird.
Can you try on a clean checkout of the repo ?
I feel like something non standard is going on, especially since --user root is the default for docker, meaning adding it should not have any effect.

@Tieske
Copy link
Contributor Author

Tieske commented Jul 1, 2024

clean repo gives me the first permissions error again:

tieskes-mbp:homieiot.github.io thijs$ docker run --rm -v $PWD:/work homie-site:dev
/work/./grabrepos.py:26: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  content = yaml.load(stream)
Clone Core to /work/temp/Core
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/git/util.py", line 941, in _obtain_lock_or_raise
    fd = os.open(lock_file, flags, 0)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/work/temp/Core/.git/config.lock'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/work/./grabrepos.py", line 232, in <module>
    checkout_repo(targetdir, entry['name'], entry['repo'], entry['filepattern'],checkoutdir, entry['keepsections'], update_repos)
  File "/work/./grabrepos.py", line 158, in checkout_repo
    repo = Repo.clone_from(repourl, localpath)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/repo/base.py", line 1308, in clone_from
    return cls._clone(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/repo/base.py", line 1237, in _clone
    with repo.remotes[0].config_writer as writer:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/remote.py", line 1134, in config_writer
    writer = self.repo.config_writer()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/repo/base.py", line 596, in config_writer
    return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/config.py", line 366, in __init__
    self._acquire_lock()
  File "/usr/local/lib/python3.12/site-packages/git/config.py", line 385, in _acquire_lock
    self._lock._obtain_lock()
  File "/usr/local/lib/python3.12/site-packages/git/util.py", line 951, in _obtain_lock
    return self._obtain_lock_or_raise()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/util.py", line 944, in _obtain_lock_or_raise
    raise IOError(str(e)) from e
OSError: [Errno 13] Permission denied: '/work/temp/Core/.git/config.lock'
tieskes-mbp:homieiot.github.io thijs$

@Tieske
Copy link
Contributor Author

Tieske commented Jul 1, 2024

running same command agina (even without root) gives me the other error:

tieskes-mbp:homieiot.github.io thijs$ docker run --rm -v $PWD:/work homie-site:dev
/work/./grabrepos.py:26: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  content = yaml.load(stream)
Traceback (most recent call last):
  File "/work/./grabrepos.py", line 232, in <module>
Wrote file: /work/content/specification/preface/spec-core-develop.md
Wrote file: /work/content/specification/spec-core-develop.md
Wrote file: /work/content/specification/spec-core-v1_5_0.md
Wrote file: /work/content/specification/spec-core-v2_0_0.md
Wrote file: /work/content/specification/spec-core-v2_0_1.md
Wrote file: /work/content/specification/spec-core-v3_0_0.md
Wrote file: /work/content/specification/spec-core-v3_0_1.md
    checkout_repo(targetdir, entry['name'], entry['repo'], entry['filepattern'],checkoutdir, entry['keepsections'], update_repos)
  File "/work/./grabrepos.py", line 174, in checkout_repo
    repo.head.reset(index=True, working_tree=True)
  File "/usr/local/lib/python3.12/site-packages/git/refs/head.py", line 104, in reset
    self.repo.git.reset(mode, commit, "--", paths, **kwargs)
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 741, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 1315, in _call_process
    return self.execute(call, **exec_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 1109, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git reset --hard HEAD --
  stderr: 'error: unable to unlink old 'readme.md': No such file or directory
fatal: Could not reset index file to revision 'HEAD'.'
tieskes-mbp:homieiot.github.io thijs$

@Thalhammer
Copy link
Member

This is really weird, ngl. I tried it on 3 different machines and it works as expected on all of them. Do you have some sort of non standard docker setup ?
I assume you are running docker on linux ?

@Tieske
Copy link
Contributor Author

Tieske commented Jul 4, 2024

just plain docker desktop on MacOS

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

2 participants