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

spaces should be allowed between the backslash and the carriage return #18

Open
rockerBOO opened this issue Oct 14, 2024 · 3 comments
Open

Comments

@rockerBOO
Copy link

VERSION 0.7
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
WORKDIR /code
RUN --mount=type=cache,target=/var/cache/apt \
		apt-get update \
		 && DEBIAN_FRONTEND=noninteractive  TZ=America/New_York apt-get install --no-install-recommends -y fonts-dejavu-core rsync git jq moreutils aria2 python3 python3-venv python3-pip ffmpeg \
    libsm6 \ 
    libxext6 \
		 && apt-get clean \
		 && rm -rf /var/lib/apt/lists/* 
ARG DEBIAN_FRONTEND=noninteractive

deps:
    RUN --mount=type=cache,target=/cache --mount=type=cache,target=/root/.cache/pip \
        aria2c -x 5 --dir /cache --out torch-2.0.1-cp310-cp310-linux_x86_64.whl -c \
        https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp310-cp310-linux_x86_64.whl && \
        pip install /cache/torch-2.0.1-cp310-cp310-linux_x86_64.whl torchvision --index-url https://download.pytorch.org/whl/cu118
    RUN pip3 install wheel
    COPY requirements.txt ./
    RUN pip wheel -r requirements.txt --wheel-dir=wheels

build:
    FROM +deps
    COPY x.py x.py
    SAVE ARTIFACT x.py /x.py
    SAVE ARTIFACT wheels /wheels

docker:
    FROM +deps
    COPY +build/x.py x.py
    COPY +build/wheels wheels
    COPY requirements.txt ./
    RUN pip install --no-index --find-links=wheels -r requirements.txt
    ENTRYPOINT ["python3", "./x.py"]
		SAVE IMAGE rockerboo/x:latest
1 failure:

correct / expected / unexpected

  1. test_long_run:

    (source_file
      (block
        (version_command
          (version_major_minor))
        (from_command
          (image_spec
            (image_name)
            (image_tag)))
        (workdir_command
          (string
            (unquoted_string)))
        (run_command
          (options
            (mount
              (string
                (unquoted_string)
                (unquoted_string))))
          (line_continuation)
          (shell_fragment
            (line_continuation)
            (line_continuation))))
      (ERROR))
)

Thanks

@glehmann
Copy link
Owner

glehmann commented Nov 9, 2024

Hi @rockerBOO , thanks for the example.
It is failing because of the trailing space after the backslash in this line:

    libsm6 \ 

I’m surprised that’s even allowed in the earthfile — I’ll give it a try :-)

@glehmann
Copy link
Owner

glehmann commented Nov 9, 2024

ok, It is indeed working.
How the eol is managed in earthfile is still puzzling me

@glehmann glehmann changed the title Error on long, multi-line RUN commands spaces should be allowed between the backslash and the carriage return Nov 9, 2024
@rockerBOO
Copy link
Author

thank you, I can work around this for now.

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

No branches or pull requests

2 participants