Giter Site home page Giter Site logo

openfaas-clojure-template's People

Contributors

ccfontes avatar tessellator avatar xvincentx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openfaas-clojure-template's Issues

faas-cli build stalled at: clojure -e "(compile 'entrypoint.core)"

faas-cli build stalls at the following step in the Dockerfile:

clojure -e "(compile 'entrypoint.core)"

See details below (verbose):

#8 [4/6] RUN clojure -Sverbose -e "(compile 'entrypoint.core)"
#8 sha256:35927bc393935f40eb61cc60a1c6da0a9f718fb0e59bd6c3875b52afd9ff9035
#8 0.214 version      = 1.10.0.411
#8 0.214 install_dir  = /usr/local/lib/clojure
#8 0.214 config_dir   = /root/.clojure
#8 0.214 config_paths = /usr/local/lib/clojure/deps.edn /root/.clojure/deps.edn deps.edn
#8 0.215 cache_dir    = .cpcache
#8 0.215 cp_file      = .cpcache/246823853.cp
#8 0.215
#8 0.216 Refreshing classpath

This only happens on my macbook M1 (arm64). Others seem to have similar issue with JVM processes, quote:

I had issues with the JVM, experiencing random process hangs. It seems that there are no official OpenJDK builds for aarch64

from https://earthly.dev/blog/using-apple-silicon-m1-as-a-cloud-engineer-two-months-in/

I confirmed that the openjdk:8u121-jdk-alpine image used in openfaas-clojure-builder doesn't support arm64 architecture:

❯ docker run --rm --platform=linux/arm64 openjdk:8u121-jdk-alpine uname -m
Unable to find image 'openjdk:8u121-jdk-alpine' locally
8u121-jdk-alpine: Pulling from library/openjdk
Digest: sha256:020e0b5248b1e4963ea1ce9b1248f153d671c8c95b6ff3c3857d0c409c5b5c65
Status: Image is up to date for openjdk:8u121-jdk-alpine
docker: Error response from daemon: image with reference openjdk:8u121-jdk-alpine was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64.
See 'docker run --help'.

Successfully attempted a fix with an alternative image supporting arm64 – balenalib/generic-aarch64-alpine-openjdk:8:

FROM balenalib/generic-aarch64-alpine-openjdk:8-20210225 as builder

LABEL maintainer="Chad Taylor <[email protected]>"
LABEL description="A base builder image for the OpenFaaS Clojure Template"

WORKDIR /home/app

RUN apk --no-cache add curl bash \
    && curl -O https://download.clojure.org/install/linux-install-1.10.0.411.sh \
    && chmod +x linux-install-1.10.0.411.sh \
    && ./linux-install-1.10.0.411.sh

WORKDIR /home/app/entrypoint
COPY . /home/app

RUN clojure -e "(compile 'entrypoint.core)" \
    && clojure -A:depstar -m hf.depstar.uberjar Entrypoint.jar \
    && if [ -f ../function/manifest.mf ] ; then echo "applying manifest" && jar umf ../function/manifest.mf ./Entrypoint.jar ; fi

Would you be interested in supporting arm64? I'd leave at your discretion to find a solution compatible with both x86 and arm64.

can't find gid for group app: no such group: app

When running faas-cli up using Docker version 2.1.0.3, I get this:

received non-zero exit code from build, error: unable to convert uid/gid chown string to host mapping: can't find gid for group app: no such group: app       

The reason is explained here PsychoinformaticsLab/pliers#413:

which occurs during COPY --from=builder --chown=pliers /opt/venv /opt/venv because if a group is not specified in --chown, the version of docker I'm using assumes the group is the same as the user (e.g., pliers), but since RUN useradd --no-user-group --create-home --shell /bin/bash pliers specifies that a group should not be added, then the error occurs since the pliers group does not exist.

Also, seems that when creating a user with adduser, Alpine doesn't create a group for said user?

To solve the issue, replaced line in:
https://github.com/tessellator/openfaas-clojure-template/blob/main/template/clojure/Dockerfile#L24
with:

RUN addgroup -S app
RUN adduser -S app -G app

Not issuing a PR, because you may have a more elegant way to solve this, like specifying some group at COPY --chown.

I can verify your fix later, but running in your local should at least assure nothing breaks. :)

Thanks.

Improve Healthcheck

There is a period of time after which the lock file used by the current healthcheck is created but the Jetty instance is not yet spun up. Requests to the function during this period receive a 500 Internal Server Error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.