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

Installation of Unicon in Linux Alpine #209

Open
eddysanoli opened this issue May 15, 2023 · 8 comments
Open

Installation of Unicon in Linux Alpine #209

eddysanoli opened this issue May 15, 2023 · 8 comments
Assignees

Comments

@eddysanoli
Copy link

Hello. Recently I've been trying to optimizing my containerized Python application by switching from Python's buster base image, to a Python Alpine image. All of my dependencies are installed during build time by using Poetry. I have a pyproject.toml file that lists all of my dependencies and installs them when I use poetry install. One of my dependencies is the Meraki Dashboard API package. That one doesn't give me any problems, but unfortunately it depends on unicon, hence why Im here. Whenever Poetry runs into unicon, it spits out the following error:

#0 37.24   RuntimeError
#0 37.24
#0 37.24   Unable to find installation candidates for unicon (23.4)
#0 37.24
#0 37.24   at /usr/local/lib/python3.8/site-packages/poetry/installation/chooser.py:109 in choose_for
#0 37.26       105│
#0 37.26       106│             links.append(link)
#0 37.26       107│
#0 37.26       108│         if not links:
#0 37.26     → 109│             raise RuntimeError(f"Unable to find installation candidates for {package}")
#0 37.26       110│
#0 37.26       111│         # Get the best link
#0 37.26       112│         chosen = max(links, key=lambda link: self._sort_key(package, link))
#0 37.26       113│

I've checked that the version is correct, that the docker container has the correct dependencies, even that my connection to the internet is stable. No matter what I do, I cannot get my alpine base image to properly install unicon. Is there any specific way that I need to know about? I found in a stackoverflow post, that alpine is kind of unreliable when it comes to Python packages that serve as wrappers for C or C++ code, but no other package is giving me this error. Im pretty sure it was my move to alpine, but I would appreciate the help if anyone could provide some advice into how I could get the project up and going with an alpine image.

Here's my dockerfile code for reference:

FROM python:3.8-alpine3.18

RUN apk update && apk add --no-cache --no-progress \
    bash \
    gcc \
    build-base \
    python3-dev \
    py3-pip \
    libffi-dev \ 
    pkgconfig \
    # TO CONVERT CRLF TO LF
    dos2unix \
    xvfb \
    wget \
    openssl \
    libssl1.1 \
    py-cryptography

# Set the default shell to bash
RUN sed -i -e "s/bin\/ash/bin\/bash/" /etc/passwd

# Move back to the default working directory for the app
WORKDIR /opt/app

# Copy the 'pyproject.toml' file, install the dependencies and then "activate"
# the environment by doing "poetry shell"
COPY pyproject.toml poetry.lock ./
RUN pip3 install poetry && poetry lock 
RUN poetry add unicon
RUN poetry install

# Copy all project files
COPY . .

EXPOSE 8080

# Run the starting script inside the poetry environment
CMD ["poetry", "run", "sh", "entrypoint.sh"]
@sumitsehgal123
Copy link

Hi Srujan,
Thanks for reaching out piestack support team, I will be looking at your ticket and reviewing it

@simingy
Copy link
Contributor

simingy commented Jun 3, 2023

iirc pypi does not allow whl file upload that is non gnu linux (manylinux1) or macos builds. so there is no whl file for unicon for alpine linux in pypi hence why the install fails

@eddysanoli
Copy link
Author

Any solution in that case?

@Taarini
Copy link
Contributor

Taarini commented Jun 27, 2023

Hi @eddysanoli,

Can you please check again we have added the package for Linux Alpine

@sumitsehgal123
Copy link

Hi ,
Please can you share updates here .

@sumitsehgal123
Copy link

Hi ,
Can you please check again we have added the package for Linux Alpine.

@sumitsehgal123
Copy link

Hi ,
Please can you share updates here .

@sumitsehgal123
Copy link

Hi ,
Please share the updates on above ticket If you need any further assistance .Please let me know .

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

4 participants