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

Nitric Up GitHub action succeeds even though the build failed #90

Open
pulpdood opened this issue Jun 25, 2024 · 6 comments
Open

Nitric Up GitHub action succeeds even though the build failed #90

pulpdood opened this issue Jun 25, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@pulpdood
Copy link
Contributor

pulpdood commented Jun 25, 2024

Bug Report

Issue

Nitric Up GitHub action still shows up as successful even though it appears the build failed.

Steps

Steps to reproduce the behavior:

  1. Create a Nitric project
  2. Create a GitHub action with Nitric GH Action using up command to deploy
  3. Have a bug in the Nitric project that will cause the build to fail
  4. Observe an error message in the build logs, but that the GH Action is still successful:
image

Expected

Expect the GH Action Workflow to fail

Environment and setup information

  • Nitric CLI Version: Nitric 1.43.0
  • Operating System: Ubuntu (GH Action Runner)
  • Nitric dependencies and their versions, such as SDKs or Middleware: Nitric Python SDK 1.0.6
  • Cloud providers you are deploying to and their version: nitric/[email protected]

Other info

Nil

@pulpdood pulpdood added the bug Something isn't working label Jun 25, 2024
@tjholm
Copy link
Member

tjholm commented Jun 25, 2024

fixed in: #87

@tjholm tjholm closed this as completed Jun 25, 2024
@pulpdood
Copy link
Contributor Author

image

@tjholm @davemooreuws I just got the behaviour again when running the Nitric GitHub Action - not sure if something was cached?

@tjholm
Copy link
Member

tjholm commented Jul 24, 2024

thanks for raising this @pulpdood will re-open this issue and see if we can get to the bottom of it.

@tjholm tjholm reopened this Jul 24, 2024
@psymbio
Copy link

psymbio commented Jul 31, 2024

@pulpdood if you don't mind can you share your Dockerfile here as well.

@pulpdood
Copy link
Contributor Author

pulpdood commented Aug 1, 2024

The error is caused by trying to install r-base=4.4.0. For some reason after a while versions become no longer existing when trying to install them on debian. To fix this I removed the version and am installing just r-base.

# syntax=docker/dockerfile:1
FROM node:bookworm as build

ARG HANDLER

# Python and make are required by certain native package build processes in NPM packages.
RUN apt-get update -y && apt-get install -y openssl
RUN apt-get install -y build-essential libpq-dev
RUN apt-get install g++ make -y
RUN apt-get install -y python3 python3-pip
RUN yarn global add typescript @vercel/ncc

WORKDIR /usr/app

COPY package.json yarn.lock ./

COPY prisma ./prisma/

RUN yarn install --production --frozen-lockfile --cache-folder /tmp/.cache && \
    rm -rf /tmp/.cache

COPY . .

RUN \
    --mount=type=cache,target=/tmp/ncc-cache \
    ncc build ${HANDLER} -s -o lib/ -e .prisma/client -e @prisma/client -t

FROM node:bookworm as final

WORKDIR /usr/app

# RUN apk update && \
#     apk add --no-cache ca-certificates R && \
#     update-ca-certificates
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    usrmerge \
    ed \
    less \
    locales \
    vim-tiny \
    wget \
    ca-certificates \
    fonts-texgyre \
    && rm -rf /var/lib/apt/lists/*

RUN echo "deb http://http.debian.net/debian sid main" > /etc/apt/sources.list.d/debian-unstable.list \
    && echo 'APT::Default-Release "testing";' > /etc/apt/apt.conf.d/default \
    && echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/90local-no-recommends

# RUN ncc build ${HANDLER} -s -o lib/ -e 

ENV R_BASE_VERSION 4.4.0

RUN apt-get update \
    && apt-get install -y -t unstable --no-install-recommends \
    usrmerge \
    libopenblas0-pthread \
    littler \
    libc-dev \
    libfribidi-dev \
    libharfbuzz-dev \
    libfontconfig1-dev \
    libsodium-dev \
    r-cran-docopt \
    r-cran-littler \
    r-base=${R_BASE_VERSION}-* \
    r-base-dev=${R_BASE_VERSION}-* \
    r-base-core=${R_BASE_VERSION}-* \
    r-recommended=${R_BASE_VERSION}-* \
    && chown root:staff "/usr/local/lib/R/site-library" \
    && chmod g+ws "/usr/local/lib/R/site-library" \
    && ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r \
    && ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \
    && ln -s /usr/lib/R/site-library/littler/examples/installBioc.r /usr/local/bin/installBioc.r \
    && ln -s /usr/lib/R/site-library/littler/examples/installDeps.r /usr/local/bin/installDeps.r \
    && ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
    && ln -s /usr/lib/R/site-library/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
    && rm -rf /var/lib/apt/lists/*

COPY package.json yarn.lock ./

COPY prisma ./prisma/

COPY rc-science ./rc-science/

RUN yarn install --production --frozen-lockfile --cache-folder /tmp/.cache && \
    rm -rf /tmp/.cache

RUN yarn prisma generate

COPY . .

COPY --from=build /usr/app/lib/ ./lib/

RUN Rscript -e "install.packages(c('RSQLite', 'plumber', 'dbplyr', 'tidyverse', 'jsonlite', 'lubridate', 'gam', 'randomForest', 'kknn', 'forecast', 'stringr', 'glmnet', 'caret', 'gbm', 'readxl', 'digest'), repos='https://packagemanager.posit.co/cran/__linux__/bookworm/latest', Ncpus=4)"

ENTRYPOINT ["node", "lib/index.js"]

@davemooreuws
Copy link
Member

davemooreuws commented Aug 1, 2024

I'll try and reproduce the error with that Dockerfile. @psymbio are you already taking a look at this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants