nitrictech / actions

Deploy continuously to your cloud of choice using your favorite language, with Nitric, Pulumi or Terraform, and GitHub!
https://nitric.io
Apache License 2.0
7 stars 1 forks source link

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

Open pulpdood opened 3 months ago

pulpdood commented 3 months ago

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

Other info

Nil

tjholm commented 3 months ago

fixed in: https://github.com/nitrictech/actions/pull/87

pulpdood commented 2 months ago
image

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

tjholm commented 2 months ago

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

psymbio commented 1 month ago

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

pulpdood commented 1 month ago

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 commented 1 month ago

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