-
Notifications
You must be signed in to change notification settings - Fork 84
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
Executable not found in $PATH #15
Comments
Now I ruled out that it is not the docker image. with |
This isn't an issue with the Action setup. The Docker image you are using doesn't have that filter baked in anywhere. Have you seen building custom images? I think what you're going to need is a small shim Dockerfile in your projcet repository that loads the Pandoc image you want to use then adds the pandoc-xnos filter that you would like to use to the image in an appropriate place. Then you can use that in your GitHub Action workflow. It would probably be a good idea to include an example of doing that properly the documentation for this repository. |
That's a nice idea! I'm trying it out and if it works, I'm going to open a PR to add the example here. |
Another solution that would work would be to use a container arrangement like in #11, but add a step that installs your filters to the container before using Pandoc. I don't think that's quite as well suited to solve this particular issue, but maybe worth mentioning in case other people with similar but not identical issues come by. |
To be fair, what I already tried was: jobs:
build-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install pandoc-fignos pandoc-tablenos pandoc-secnos
- run: |
mkdir public
echo "FILELIST=$(printf '"%s" ' src/sections/*.md)" >> $GITHUB_ENV
- name: Build Report to HTML
uses: docker://pandoc/latex:2.11.4
with:
args: >-
--filter pandoc-xnos
--metadata-file=src/metadata.yaml
--citeproc
--bibliography=src/bibliography.bib
--toc
--standalone
--output=public/index.html
${{ env.FILELIST }} So I basically installed python, pip and the executables. But it seems that they are not transferred into the docker execution. |
What that effectively did was install Pip and your desired filters inside the My second suggestion (re #11) was to use the |
Yea that was what I imagined.. I'm going to try the customized Dockerfile approach |
Just to save you a little time getting started chasing dependencies, you'll need something like this to get rolling with compiling FROM pandoc/latex:2.11.4
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 python3-dev py3-pip py3-setuptools gcc musl-dev linux-headers
RUN pip install --no-cache --upgrade pandoc-fignos pandoc-tablenos pandoc-secnos If this was not for one time use I would do a two stage thing where you build on on image then copy the result into a clean container without all the header baggage, but the use case discussed above in a one-off that needs to be built on every CI run, so this seems like the fastest way to get from point A to point B. |
Following up on that, to use it in a project I think you'll want to save that as - name: Build modified Pandoc Docker image
run: docker build -t my-pandoc
- name: Use modified Pandoc
run: >-
docker run my-pandoc
--filter pandoc-xnos
--metadata-file=src/metadata.yaml
--citeproc
--bibliography=src/bibliography.bib
--toc
--standalone
--output=public/index.html
${{ env.FILELIST }} Obviously you can adjust paths to hide the Dockerfile somewhere or use |
That's a pretty clever idea. I was just googling on how to provide local docker images to "uses" clauses. |
Just for completeness, there is another way to do it to. By including an Of course if this is something you use a lot you could make your own action and push the Docker images to either Docker Hub or GitHub Packages and reference it directly. That would save a little build time on each CI run in exchange for having to maintain another project. |
I just thought you can probably avoid having a - name: Build modified Pandoc Docker image
run: |
cat <<- EOF | docker build -t my-pandoc
FROM pandoc/latex:2.11.4
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 python3-dev py3-pip py3-setuptools gcc musl-dev linux-headers
RUN pip install --no-cache --upgrade pandoc-fignos pandoc-tablenos pandoc-secnos
EOF
- name: Use modified Pandoc
run: >-
docker run my-pandoc
--filter pandoc-xnos
--metadata-file=src/metadata.yaml
--citeproc
--bibliography=src/bibliography.bib
--toc
--standalone
--output=public/index.html
${{ env.FILELIST }} This way you don't clutter up your repo with things that or only useful for CI and CI is contained in one workflow file. |
Alright... I tried. I gave up now :) Only problem now is:
😐 |
But this is now solved via |
I appreciate that you've found a solution that works for you (and not a bad one at all), but would you mind if we keep this open until I or somebody hashes out how it can be done? I'm sure you're not the only one with this scenario to deal with, in fact I have a similar case coming up (which is why I had been thinking about ideas already). |
Yes of course! I have an idea.. maybe it would be an option to actually create a valid github action with pandoc baked in. Then one could use input fields to define additional packages to be installed (either latex packages with |
Yes, adding input argument(s) that install relevant packages from various ecosystems (don't forget Lua) as needed is an option. For several reasons I was hoping to not need to go there and that there would be add-hoc ways of doing this that could ultimately be more flexible, but if they aren't very user friendly that might be a reason to overcome some of the challenges with installing additional packages at runtime as a runner option. |
For anyone interested or my future self if/when I get around to documenting this, you can run a GitHub action using the current repo as the action like this: - uses: ./ |
When using the docker action of pandoc the following error occurs:
The problem seems to be that the
ENTRYPOINT
is not set anymore?(note that pandoc-xnos is installed via PIP)
The text was updated successfully, but these errors were encountered: