Add 3rd party rules

Needed to refactor the E1 Rule first.
There is no need to depend on org.springframework.


Use alternative syntax higlighter to highlight.js?

I would like to use Prism rather than highlight.js, because of its reduced size among other things. Is this possible?

Same question, would be great if there is some kind of customisation for passing Prism instead of Highlight.


Fix boolean type MSSQL.

Q
A

Is bugfix?
✔

New feature?
❌

Breaks BC?
❌

What is fixed here exactly?

In new versions of MSSQL, the tinyint and bit data types no longer have a size, so when declaring $this->boolean() in the migration, it won't function as intended. This change accommodates compatibility with older versions that still support specifying size for these data types, as well as with newer versions where tinyint always has a size of 3 and bit always has a size of 1.


Edit the README file

Edit the README file
Generate a README file that informs any potential user about the application and how to test and use it.

Generated the README file to instruct any potential user of its usage.


One FAQ entry not showing on the Sources page

Description & motivation

The name of the FAQ file misses an s.
Would there be a way to do those checks automatically?

Fixed in the Preview:

thank you for that flag @b-per and also asking @JKarlavige whether it is possible to check automatically:

Would there be a way to do those checks automatically?


make have bug

error: cannot convert ‘const IndicesPtr’ {aka ‘const boost::shared_ptr<std::vector<int, std::allocator > >’} to ‘const IndicesConstPtr&’ {aka ‘const std::shared_ptr<const std::vector<int, std::allocator > >&’}
60 |     this->m_kd_tree->setInputCloud(m_in_cloud, m_indices);
|                                                ^~~~~~~~~
|                                                |
|                                                const IndicesPtr {aka const boost::shared_ptr<std::vector<int, std::allocator > >}
In file included from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/../include/Normal2dEstimation.h:14,
from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:5:
/usr/local/include/pcl-1.12/pcl/search/search.h:121:47: note:   initializing argument 2 of ‘void pcl::search::Search::setInputCloud(const PointCloudConstPtr&, const IndicesConstPtr&) [with PointT = pcl::PointXYZ; pcl::search::Search::PointCloudConstPtr = std::shared_ptr<const pcl::PointCloudpcl::PointXYZ >; pcl::search::Search::IndicesConstPtr = std::shared_ptr<const std::vector<int, std::allocator > >]’
121 |                        const IndicesConstPtr &indices = IndicesConstPtr ());
|                        ~^~~~~~
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp: In member function ‘void Normal2dEstimation::compute(const Ptr&) const’:
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:125:48: error: cannot convert ‘const IndicesPtr’ {aka ‘const boost::shared_ptr<std::vector<int, std::allocator > >’} to ‘const IndicesConstPtr&’ {aka ‘const std::shared_ptr<const std::vector<int, std::allocator > >&’}
125 |     this->m_kd_tree->setInputCloud(m_in_cloud, m_indices);
|                                                ^~~~~~~~~
|                                                |
|                                                const IndicesPtr {aka const boost::shared_ptr<std::vector<int, std::allocator > >}
In file included from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/../include/Normal2dEstimation.h:14,
from /home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:5:
/usr/local/include/pcl-1.12/pcl/search/search.h:121:47: note:   initializing argument 2 of ‘void pcl::search::Search::setInputCloud(const PointCloudConstPtr&, const IndicesConstPtr&) [with PointT = pcl::PointXYZ; pcl::search::Search::PointCloudConstPtr = std::shared_ptr<const pcl::PointCloudpcl::PointXYZ >; pcl::search::Search::IndicesConstPtr = std::shared_ptr<const std::vector<int, std::allocator > >]’
121 |                        const IndicesConstPtr &indices = IndicesConstPtr ());
|                        ~^~~~~~
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp: In member function ‘bool Normal2dEstimation::computePointNormal2d(boost::shared_ptr<std::vector<int, std::allocator > >&, Eigen::Vector3f&) const’:
/home/chenxiaocong/cvte_work/slam/code/PCL-Normal-Estimation-2d/src/Normal2dEstimation.cpp:268:27: error: no matching function for call to ‘pcl::PCApcl::PointXYZ::setIndices(boost::shared_ptr<std::vector<int, std::allocator > >&)’
268 |     pca.setIndices(indices);

This code is quite old now so it is not compliant with new PCL version. For instance, new version no longer uses boost::shared_ptr.
One thing you can do is to change the local IndicesPtr type def (in file include/Normal2dEstimation.h:L26) from boost::shared_ptr<std::vector<int> > to const std::shared_ptr<const std::vector<int, std::allocator > >.
I'm not sure if this idea will work, but you can try it. Otherwise, trying to update the code with the new PCL API doesn't seem to be a big deal.
Good lucK


Make Member::joined_at return Timespec / Tm instead of ISO8601-formatted time/date string

It just feels right to return rust data structures instead of raw data.

Fixed by 990e611.


can`t configure empty_line_ignoreing

Describe the bug
i want to ignore empty lines,but cant write .converagerc properly.i tried put ^\s*\r?\n$ or ^\s*$ in exclude_lines,but doesnt work
To Reproduce
How can we reproduce the problem?  Please be specific. Don't link to a failing CI job. Answer the questions below:

python 3.10
coverage 7.2.5
code:

def test_case_evaluate(program, test_case):
    test_case = "from program import *\n\n" + test_case
    with open("program.py", "w") as f:
        f.write(program)
    with open("test_case.py", "w") as f:
        f.write(test_case)

    cov = coverage.coverage(source=["program"], config_file=True)
    cov.start()
    suite = unittest.TestLoader().loadTestsFromName("test_case")
    result = unittest.TextTestRunner().run(suite)
    cov.save()
    cov.stop()
    cov_rate = cov.report()
    cov.json_report()

    #  result=(success*1+failures*0+errors*(-1))/total
    failures = len(result.failures)
    errors = len(result.errors)
    total = result.testsRun
    valid_rate = (total - failures - 2 * errors) / total
    return round(cov_rate / 100, 3), round(valid_rate, 3)

config file:
[report]
exclude_lines =
    ^\s*\r?\n$

Expected behavior
tell me how to ignore empty lines
Additional context
Add any other context about the problem here.

sorry，make mistake


User-reported unhelpful error message

Program: https://code.world/#PLYtyOmCYLZ7Rz_AhEkjMgQ
Comment:
Does not state.
Message:
program.hs:2:27-35: error:
    Ambiguous occurrence rectangle
    It could refer to either rectangle,
                             defined in the standard library
                          or rectangle, defined at program.hs:7:1

Unclear what this is referring to.  The error message is very clear.


Updated ironstrings to work with Python3.

Fixed the previous PR based on reviewer's comments.

Looks good, thank you. For reference, you could have committed to your previous branch in the other PR.


[Request] Use Non-Chinese CDN

🥰 需求描述 | Feature Description
Chinese Great Firewall seems to be blocking my (static, unchangeable) IPs.
🧐 解决方案 | Proposed Solution
Upload the assets that are fetched from CDN to a different CDN, like jsDelivr or CDNjs.
📝 补充信息 | Additional Information
$ curl -v https://npm.elemecdn.com
*   Trying <IP_ADDRESS>:443...
* connect to <IP_ADDRESS> port 443 failed: Connection timed out
*   Trying <IP_ADDRESS>:443...
* After 84400ms connect time, move on!
* connect to <IP_ADDRESS> port 443 failed: Connection timed out
*   Trying <IP_ADDRESS>:443...
* After 42200ms connect time, move on!
* connect to <IP_ADDRESS> port 443 failed: Connection timed out
*   Trying <IP_ADDRESS>:443...
* After 21099ms connect time, move on!
* connect to <IP_ADDRESS> port 443 failed: Connection timed out
*   Trying <IP_ADDRESS>:443...
* After 10549ms connect time, move on!
* connect to <IP_ADDRESS> port 443 failed: Connection timed out
*   Trying <IP_ADDRESS>:443...
* After 5275ms connect time, move on!
* connect to <IP_ADDRESS> port 443 failed: Connection timed out
*   Trying <IP_ADDRESS>:443...
* After 2636ms connect time, move on!
* connect to <IP_ADDRESS> port 443 failed: Connection timed out
* Failed to connect to npm.elemecdn.com port 443: Connection timed out
* Closing connection 0
curl: (28) Failed to connect to npm.elemecdn.com port 443: Connection timed out

Is that the resource cited here https://github.com/lobehub/lobe-ui/blob/b1f0327b7e68a44a12917f133b2847702e971387/.dumirc.ts#L63

Maybe you can modify this tool method to switch cdn? https://github.com/lobehub/lobe-ui/blob/b1f0327b7e68a44a12917f133b2847702e971387/src/utils/genCdnUrl.ts#L12-L15

It felt like it couldn't take care of everyone and had to manually change some of the code

Hi hi!
Meanwhile we are the global cdn provider which can help with acceleration of static and dynamic.
Also we have option for mainland China cdn delivery by providing cdn domain with enabled mainland china acceleration.
Do you want to try our solution to compare the quality ?

@Wxh16144 If using a different CDN is not an option for you, could you then maybe include these files locally with the theme?

ConfigProvider
The proxy provides two CDN resolution addresses, aliyun and unpkg, with aliyun as the default. This can be configured through the cdn attribute of ConfigProvider.
At the same time, it provides custom CDN configuration, set proxy to custom and configure through the customCdnFn attribute.
import { ConfigProvider, Logo } from '@lobehub/ui';

export default () => {
  return (
    <ConfigProvider config={{
        proxy: 'custom',
        customCdnFn: (e: {pkg:string, version:string, path:string}) => `https://yourcdn/${pkg}/${version}/${path}`
    }}>
      <Logo />
    </ConfigProvider>
  );
};


Support for including custom stylesheets and scripts into default UI

This adds back some support for including custom stylesheets and scripts to the default UI. This feature existed in previous versions of Swashbuckle and I still find it useful. I decided not to include embedded resource support, as that can be a concern of the individual applications to use the EmbeddedFileProvider if they need something like that.

I'm not sure why these diff's are showing whole file differences. I did this work on a Mac. I wonder if it's line ending differences.

Please hold off on merging this, I just realized that I did not implement the javascript portion here correctly and the scripts run too early. I will add a commit that ensures the custom scripts don't execute until after the swaggerUI has initialized.

I just updated the script injection so that it worked the same as in Swashbuckle 5 where the custom scripts aren't executed until the UI has initialized.


Secretless has a DB2 connector

Objective
Adds a DB2 database connector to Secretless, so it can proxy connections to a DB2 backend.
Feature Overview
Details TBA, but DB2 appears to support username/password based authn.
If this connector is interesting for you, please share info about the DB2 versions you're using, the authentication mode your server is configured with, and the client you're using to connect to it.
AC:

[ ] Secretless can proxy DB2 user/pass auth
[ ] There are tests for this functionality

Story Breakdown
To be added. Will include handler, tests, documentation, etc.

Here is a link to a OSS go driver for DB2:  https://github.com/ibmdb/go_ibm_db

We can download a dev DB2 (Db2 Database 11.5) instance here: https://www.ibm.com/account/reg/us-en/signup?formid=urx-33669


Plugin not working on Windows 10

Plugin does not work on a Windows 10 host. ReClass simply does not recognize it as a plugin.

The root cause for this was that ReClass.NET requires some resource fields to be set on Windows.
This can be seen here: https://github.com/ReClassNET/ReClass.NET/blob/93850bf5c40e79f075640ddecc438ee4d109310e/ReClass.NET/Plugins/PluginManager.cs#L72
I added the fields on the current master branch. Can you confirm if it works for you now?

Works as intended now! Thanks for the support.


WIP New features

Changes:

Configurable parameters for relationship detection. You can setup each plugin separately.

related:
  entity:
    min_shared: 1
  document:
    min_shared: 2

Tika with default settings fails to extract metatada because of tesseract timeout on big tiff files. Tika with disabled tesseract parser can be used for metadata extraction.
Tika config for no-tesseract mode:

<?xml version="1.0" encoding="UTF-8"?>
<properties>
  <parsers>
    <parser class="org.apache.tika.parser.DefaultParser">
      <parser-exclude class="org.apache.tika.parser.ocr.TesseractOCRParser"/>
    </parser>
  </parsers>
</properties>

crontab line:
@reboot java -jar /tika-server-1.14.jar -c /tika-no-ocr.xml -h <IP_ADDRESS> -p 9999 > /var/log/tika-no-ocr.log 2>&1 &

Gransk config:
tika_meta: "localhost:9999"

Option to specify tesseract languages (default: English).

ocr_languages: "eng+rus"

Detect scanned pdf and convert them into tiff. This makes tika to use tesseract for text extraction. It can be disabled in config file.

detect_scanned_pdf: 0

Are pdfinfo, pdfimages and gs dependencies that need to be included in the installation files?

It seems I have broken something. I need time to fix tests.

Changes Unknown when pulling 98ae5604465221a5ef1f986320726168a4be107d on Shura1oplot:improvements into ** on pcbje:master**.

Changes Unknown when pulling eaa23e182f851e74056e5cf5713064151bc913f9 on Shura1oplot:improvements into ** on pcbje:master**.


change: [UIE-7308] - notification for resizing database

Description 📝
Bell icon / Alert changes:
System notify users when database resizing starts, display a progress bar which disappears upon completion, update status from 'Active' to 'Resizing', show resizing progress in percentage, and revert to 'Active' status when finished.
Option to switch between dedicated and shared plans, with the exception of switching from dedicated plan to a shared plan of the same size.
Changes  🔄

Notification / Event of resizing Start
Notification progress bar in Bell icon Alert
Notification complete – bar disappears
Shared to dedicated and back plan change
Status Changes from Active to Resizing
Rendering progress % numbers in UI
Changing back to Active when done

How to test 🧪
Open application, navigate to /databases, select the database cluster. Go to the Resize tab, choose a plan, and click the 'Resize Database Cluster' button. In the popup window, confirm the resizing by entering the name of the database cluster, then click 'Resize Cluster' button. You can monitor the resizing status in the Summary and Resize tabs, as well as in a table on the Databases page. Additionally, notification about scheduled resizing and a progress bar which disappears upon completion in bell icon dropdown.

Could you please share any insight with the following..
When an action is successful we denote the toast notifications with green color.

Here is an example for volume being resized.

Could you please share any insight with the following..
When an action is successful we denote the toast notifications with green color.
Here is an example for volume being resized.
Also, there is a discrepancy with the copy of the toast notification. Normally, only notifications for account or profile actions will start the message with Your ...

We have a blue notification (info) indicating that the database cluster will be resized, similar to the behavior of Linode Resize.
A green notification (success) means, for example, that the database was successfully resized, indication successful completion, while red notification indicates that the action was not successful.

Regarding the text in the notification I will update it to "Database cluster {cluster name} is being resized."

@mpolotsk-akamai looks like there are merge conflicts that need to be addressed

@hana-linode , merge conflicts have been resolved

Thanks for making the changes.


How to create a new route when one is already selected?

The route edition tool is very nice but when a file is selected, I don't know how to create a new one from scratch. It works when no file is selected so maybe I'm just missing a way to unselect everything? The only workaround I found is to refresh the page.
Sorry if I'm missing something obvious :)

To create a new file: "File" -> "New".
To deselect a file, you can Ctrl/Cmd+click on it.
You can find all of that in the documentation: https://gpx.studio/help.

Thanks for the answer! Indeed, I missed the "File > New" option, that works. However, I did try Ctrl+click to unselect a file but it doesn't seem to work on my side. I'm on Linux and I tried on Chrome and Firefox.

I just realized there was an issue with Ctrl+clicking directly on the line.
Now you can either Ctrl+click on the file tab, or on the line on the map.
Can you confirm it works for you?

I just tested, it does work if I Ctrl+click on the line, but it doesn't work if I Ctrl+click on the file tab.

There was also an issue with this for non-Mac users. Can you try again?
I can't believe this feature was bugged since the beginning, it's so important to be able to select multiple files 😵

It works now! :tada:
Thanks! :)

Cool, thank you for bringing this major issue to light!


Incorrect work query of some EMBEDDED values

OrientDB Version: 2.2.28
Java Version: OpenJDK 1.8
OS: Ubuntu 16.04
Hi, I need to create filter by some values in document EMBEDDED field, but something is wrong.
Steps to reproduce

CREATE CLASS TestEmbedded
CREATE PROPERTY TestEmbedded.name STRING
CREATE PROPERTY TestEmbedded.embedded EMBEDDED
INSERT INTO TestEmbedded SET name = "test_1", embedded = {"name": "test_1"}
INSERT INTO TestEmbedded SET name = "test_2", embedded = {"name": "test_2"}
SELECT FROM TestEmbedded - returns two documents
SELECT FROM TestEmbedded WHERE embedded IN (SELECT FROM (SELECT EXPAND(embedded) FROM $current) WHERE ANY() LIKE "test_1") - returns document with name "test_1" - works fine.
SELECT FROM TestEmbedded WHERE embedded IN (SELECT FROM (SELECT EXPAND(embedded) FROM $current) WHERE ANY() LIKE "test_2") - don't return something, but must return document with name "test_2" and embedded record {"name": "test_2"}

If execute this queries all works fine:

SELECT FROM (SELECT EXPAND(embedded) FROM TestEmbedded) WHERE ANY() LIKE "test_1" - returns embedded record {"name":"test_1"}
SELECT FROM (SELECT EXPAND(embedded) FROM TestEmbedded) WHERE ANY() LIKE "test_2" - returns embedded record {"name":"test_2"}
SELECT FROM (SELECT EXPAND(embedded) FROM TestEmbedded) - returns two embedded records

Thanks,
Vitaliy.

Sorry, I write incorrect SQL query.
Can you tell me how to write SQL query for getting result with documents which contains embedded field with given value?
Thanks,
Vitaliy.

Hi @WeaxMe
any() operator is quite tricky, so we always discourage to do use it.
In this case, the best solution is to just use dot notation, eg.

if you know the field name

SELECT FROM TestEmbedded WHERE embedded.name = 'test_2'

if you don't know the field name and you are interested in any fields that have that value:

SELECT FROM TestEmbedded WHERE embedded.values() CONTAINS 'test_2'

I hope it helps
Thanks
Luigi

Hi @luigidellaquila
In most cases I don't know the field name and I can  not use SQL like this:
SELECT FROM TestEmbedded WHERE embedded.name = 'test_2'
I test SQL:
SELECT FROM TestEmbedded WHERE embedded.values() CONTAINS 'test_2'
and it's don't work. I get empty result.
If I execute SQL:
SELECT embedded.values() FROM TestEmbedded'
I get empty result too.
Thanks,
Vitaliy.

Ok, this could be a bug, let me check it...
Thanks
Luigi

Oh, ok, I got the problem, embedded is an embedded document, not an embedded map.
I think I can make values() also manage document field values. I'll update you soon
Thanks
Luigi

Hi @WeaxMe
I just pushed a fix on 2.2.x and develop branches. It will be released with 2.2.30
Thanks
Luigi

Thank you


[Turborepo] Add a with-docker-pnpm example

Which project is this feature idea for?
Turborepo
Describe the feature you'd like to request
pnpm is the package manager of the other examples so it's weird that the with-docker example uses yarn.
It would be nice to have a with-docker-pnpm example too.
Describe the solution you'd like
The solution should use pnpm fetch which is the recommended way to use pnpm with docker
Describe alternatives you've considered
I was able to create a version with pnpm but it doesn't use pnpm fetch so I don't think it's the best way to use it

Here's my working version with pnpm. I just copied the example with yarn and replaced it with pnpm
FROM node:18-alpine AS base

FROM base AS builder
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN npm install -g turbo
COPY . .
RUN turbo prune --scope=docs --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# First install the dependencies (as they change less often)
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN corepack enable
RUN pnpm install --frozen-lockfile

# Build the project
COPY --from=builder /app/out/full/ .
RUN pnpm dlx turbo run build --filter=docs

FROM base AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=installer /app/apps/docs/next.config.js .
COPY --from=installer /app/apps/docs/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/docs/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/docs/.next/static ./apps/docs/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/docs/public ./apps/docs/public

CMD node apps/docs/server.js

Hi, here is my version. Please let me know if there is any way to improve it.
FROM node:18.16.0-alpine3.17 AS base
ARG PNPM_VERSION=8.6.2
ENV HUSKY=0
ENV CI=true
ENV PNPM_HOME=/usr/local/bin

RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate
WORKDIR /app

FROM base AS setup
RUN pnpm add -g turbo
COPY . .
RUN turbo prune --scope=@acme/docs --docker

FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --update --no-cache libc6-compat && rm -rf /var/cache/apk/*

COPY .gitignore .gitignore
COPY --from=setup /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=setup /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=setup /app/out/full/patches ./patches
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch
 # ↑ By caching the content-addressable store we stop downloading the same packages again and again

# First install dependencies (as they change less often)
COPY --from=setup /app/out/json/ ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
 pnpm install<EMAIL_ADDRESS>-r --workspace-root --frozen-lockfile \
 --unsafe-perm \
 # ↑ Docker runs pnpm as root and then pnpm won't run package scripts unless we pass this arg
 | grep -v "cross-device link not permitted\|Falling back to copying packages from store"
 # ↑ Unfortunately using Docker's 'cache' mount type causes Docker to place the pnpm content-addressable store
 # on a different virtual drive, which prohibits pnpm from symlinking its content to its virtual store
 # (in node_modules/.pnpm), and that causes pnpm to fall back on copying the files.
 # And that's fine!, except pnpm emits many warnings of this, so here we filter those out.

# Build the project and its dependencies
COPY --from=setup /app/out/full/ ./
COPY turbo.json turbo.json
RUN pnpm run build<EMAIL_ADDRESS>
FROM base AS dev
COPY --from=builder /app/ ./
WORKDIR /app/apps/docs

FROM builder AS pruned
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
 pnpm --filter=@acme/docs --prod deploy pruned --config.ignore-scripts=true

FROM node:18.16.0-alpine3.17 AS runner
WORKDIR /app
COPY --from=pruned /app/pruned/ ./

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nodejs
USER nodejs
EXPOSE 8080

CMD ["node", "./dist/server.js"]

@nicu-chiciuc I think this issue should be elevated, since the only reason I've chosen pnpm is that the official docs recommend using it:

That's exactly my point here. The Docker examples were made with yarn but the rest of the docs and other examples use and recommend pnpm.

For posterity sake, here's how I made it work for me:
The most important part was this comment: https://github.com/vercel/turbo/issues/1997#issuecomment-1273565773
Basically I had to also add
**/node_modules

to my .dockerignore file (I already had node_modules)
Before adding **/node_modules I had issue on the COPY --from=builder /app/out/full/ . step.
And here's my current Dockerfile:
FROM node:20 as base
    # Update apt-get and install the necessary libraries
    # This is mainly so that the `canvas` package can be installed
    RUN apt-get update && \
        apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

FROM base AS builder
    WORKDIR /app

    ENV APP_NAME=my_secret_project

    # This might be necessary when switching to alpine
    # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
    # RUN apk add --no-cache libc6-compat

    RUN npm install -g turbo

    COPY . .

    RUN turbo prune --scope=@my_secret_org/${APP_NAME} --docker

FROM base as installer
    WORKDIR /app
    ENV APP_NAME=my_secret_project

    RUN npm install -g pnpm
    RUN npm install -g turbo

    # First install dependencies (as they change less often)
    COPY .gitignore .gitignore
    COPY --from=builder /app/out/json/ .
    COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
    RUN pnpm install

    # Build the project and its dependencies
    COPY --from=builder /app/out/full/ .
    COPY turbo.json turbo.json

    # Uncomment and use build args to enable remote caching
    # ARG TURBO_TEAM
    # ENV TURBO_TEAM=$TURBO_TEAM

    # ARG TURBO_TOKEN
    # ENV TURBO_TOKEN=$TURBO_TOKEN

    RUN turbo run build<EMAIL_ADDRESS>
FROM base AS runner
    WORKDIR /app
    ENV APP_NAME=my_secret_project

    RUN npm install -g pnpm

    # Don't run production as root
    # RUN addgroup --system --gid 1001 expressjs
    # RUN adduser --system --uid 1001 expressjs

    # USER expressjs
    COPY --from=installer /app .

    # TODO: Maybe use the npm script?
    CMD pnpm --filter "@my_secret_org/${APP_NAME}" run start

I know that this dockerfile is much less optimized than the versions in other comments.
I've used node:20 instead of an alpine version since my plan is to (probably) make it work in a dev-container and I assume I'll need a full-fledged version.
And I also wanted to make it simple/clear enough so that I can change it if necessary.

And now I realize that I've used FROM base for all steps 🤦♂ and I'll have to fix it.

I created https://github.com/vercel/turbo/pull/5536, I think it should solve the issue.

I came across this issue today looking for some insights around a missing lockfile in the out/json directory where pnpm-workspace.yaml is copied.
➜  tree out -L 3
out
├── full
│   ├── apps
│   │   └── frontend
│   ├── package.json
│   ├── packages
│   │   ├── constants
│   │   ├── discord
│   │   ├── features
│   │   ├── github
│   │   ├── prisma-client
│   │   ├── scripts
│   │   ├── support
│   │   └── type-helpers
│   ├── pnpm-workspace.yaml
│   └── turbo.json
├── json
│   ├── apps
│   │   └── frontend
│   ├── package.json
│   ├── packages
│   │   ├── constants
│   │   ├── discord
│   │   ├── features
│   │   ├── github
│   │   ├── prisma-client
│   │   ├── scripts
│   │   ├── support
│   │   └── type-helpers
│   └── pnpm-workspace.yaml
├── pnpm-lock.yaml
└── pnpm-workspace.yaml

I also noticed a few comments here show patches getting captured as well. Are y'all adding that directory as a workspace?
I've been tinkering with a pnpm+turbo+docker setup for the past few days and here's what I've noticed:

pnpm prune doesn't ignore lifecycle scripts. be careful how you structure your npm scripts for when you're pruning the virtual store for the final build image
when using pnpm fetch, I originally did not think it supported --ignore-scripts but apparently it does! I'd recommend adding that. If any of the installed dependencies have a postinstall step that calls a transient dependencies bin then it will fail without --ignore-scripts.
if you do not install turbo globally with npm you will either need to set up the pnpm global scope, or run via pnpm dlx which doesn't seem to cache well (10s+ on each build)

when running dlx pnpm will unfortunately not load turbo from the virtual store but rather the registry which is likely the cause for the delay on build

In my experience pnpm and turbo seem to have conflicting approaches to building a docker image.
pnpm fetch is exclusive to pnpm and fetches all dependencies in the project, loading them into the virtual store. This caches well and has a negligible impact to build time.
turbo prune ... --docker will generate a pruned lockfile, which we can then use pnpm fetch on (but we need turbo installed first`)
What I've landed on is to use turbo for building only with a mix of pnpm deploy:
#syntax=docker/dockerfile:1.4
ARG NODE_VERSION="18.15.0"
ARG ALPINE_VERSION="3.17"
FROM --platform=linux/amd64 node:${NODE_VERSION}-alpine${ALPINE_VERSION} as base
# for turbo - https://turbo.build/repo/docs/handbook/deploying-with-docker#example
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /workspace
# enable corepack for pnpm
RUN corepack enable

FROM base as fetcher
# pnpm fetch only requires lockfile, but we'll need to build workspaces
COPY pnpm*.yaml ./
COPY patches ./patches
# mount pnpm store as cache & fetch dependencies
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm-store \
  pnpm fetch --ignore-scripts

FROM fetcher as builder
WORKDIR /workspace
COPY . .
RUN --mount=type=secret,id=env,required=true,target=/workspace/.env \
  pnpm install --frozen-lockfile --offline --silent
# build app
RUN --mount=type=secret,id=env,required=true,target=/workspace/.env \
  --mount=type=cache,target=/workspace/node_modules/.cache \
  pnpm turbo run build --filter="frontend"

FROM builder as deployer
WORKDIR /workspace
# deploy app
RUN pnpm --filter ./apps/frontend deploy --prod --ignore-scripts ./out

FROM base as runner
WORKDIR /workspace
# Don't run production as root
RUN addgroup --system --gid 1001 mygroup
RUN adduser --system --uid 1001 myuser
USER amplifyuser
# copy files needed to run the app
COPY --chown=myuser:mygroup --from=deployer /workspace/out/package.json .
COPY --chown=myuser:mygroup --from=deployer /workspace/out/node_modules/ ./node_modules
COPY --chown=myuser:mygroup --from=deployer /workspace/out/build/ ./build
# start the app
CMD pnpm run start

This results in a ~650MB build image in a relatively small monorepo and ~300s builds with no cache. Half of that docker build time is actually from turbo build. Have y'all figured out how to use the .turbo cache in the build effectively (with buildkit cache or otherwise -- afaict I'm not ignoring .turbo dirs)?

Had same problem on COPY --from=builder /app/out/full/ . line as everyone else using pnpm.
Added **/node_modules to root .dockerignore to resolve.
Then ran into issues with the last 3 COPY lines. Needed to also copy the next.config.js from the with-docker example. tldr- I was missing output: standalone
Ended up with this. I like it because pnpm and turbo are pulled to "base", allowing me to just use bare alpine in the end result.
copied from the with-docker example and updated to use pnpm.
# src Dockerfile: https://github.com/vercel/turbo/blob/main/examples/with-docker/apps/web/Dockerfile
FROM node:18-alpine AS alpine

# setup pnpm on the alpine base
FROM alpine as base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN pnpm install turbo --global

FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
COPY . .
RUN turbo prune --scope=web --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
RUN pnpm install

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM

# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN

RUN turbo run build --filter=web

# use alpine as the thinest image
FROM alpine AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public

CMD node apps/web/server.js

Would any of you be interested in making a PR to update the with-docker example? We're ok with switching away from yarn

https://github.com/vercel/turbo/pull/5536 got closed but not merged.  So was the PR not correct and / or what else needs to happen to get the with-docker example updated? Thanks.

Hi all, I've figure out a version for pnpm+turborepo+nextjs(standalone output), please take a look:
FROM node:18-alpine AS base
RUN apk add --no-cache libc6-compat
RUN npm install -g pnpm
RUN npm install -g turbo

FROM base AS pruner
WORKDIR /app

COPY . .

RUN turbo prune {your_app_name} --docker

FROM base as builder
WORKDIR /app

COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml

RUN pnpm install  --frozen-lockfile

COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json

RUN pnpm --filter {your_app_name} --prod deploy full
WORKDIR /app/full
RUN pnpm run build
RUN rm -rf ./.next/cache

FROM base AS runner
WORKDIR /app

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=builder /app/full/next.config.js .
COPY --from=builder /app/full/package.json .

COPY --from=builder --chown=nextjs:nodejs /app/full/.next .
COPY --from=builder --chown=nextjs:nodejs /app/full/.next/static ./standalone/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/full/public ./standalone/public

CMD node ./standalone/server.js

This result a ~300MB build image.
Basically I just cd into pruned/full folder make by turbo prune and build the app in the folder after executing pnpm deploy (I think it is used to copy real dependency file from pnpm store), and then copy the production code to the root of workdir in my runner stage.

Привет всем, я нашел версию для pnpm+turborepo+nextjs (автономный вывод), пожалуйста, посмотрите:
FROM node:18-alpine AS base
RUN apk add --no-cache libc6-compat
RUN npm install -g pnpm
RUN npm install -g turbo

FROM base AS pruner
WORKDIR /app

COPY . .

RUN turbo prune {your_app_name} --docker

FROM base as builder
WORKDIR /app

COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml

RUN pnpm install  --frozen-lockfile

COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json

RUN pnpm --filter {your_app_name} --prod deploy full
WORKDIR /app/full
RUN pnpm run build
RUN rm -rf ./.next/cache

FROM base AS runner
WORKDIR /app

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=builder /app/full/next.config.js .
COPY --from=builder /app/full/package.json .

COPY --from=builder --chown=nextjs:nodejs /app/full/.next .
COPY --from=builder --chown=nextjs:nodejs /app/full/.next/static ./standalone/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/full/public ./standalone/public

CMD node ./standalone/server.js

В результате получается образ сборки размером около 300 МБ. По сути, я просто перехожу в обрезанную/полную папку turbo pruneи собираю приложение в папке после выполнения pnpm deploy(я думаю, что оно используется для копирования реального файла зависимостей из хранилища pnpm), а затем копирую рабочий код в корень рабочего каталога в моем бегуне. этап.

Hi! Great job! But for some reason my stats didn't load. Correctly the copying a bit
FROM node:18-alpine AS base
RUN apk add --no-cache libc6-compat
RUN npm install -g pnpm
RUN npm install -g turbo

FROM base AS pruner
WORKDIR /app

COPY . .

RUN turbo prune {your_app_name} --docker

FROM base as builder
WORKDIR /app

COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml

RUN pnpm install  --frozen-lockfile

COPY --from=pruner /app/out/full/ .
COPY .env.production ./apps/main/.env.production
COPY turbo.json turbo.json

RUN pnpm --filter {your_app_name} deploy full
WORKDIR /app/full
RUN pnpm run build
RUN rm -rf ./.next/cache

FROM base AS runner
WORKDIR /app

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=builder /app/full/next.config.js .
COPY --from=builder /app/full/package.json .

COPY --from=builder --chown=nextjs:nodejs /app/full/.next .
COPY --from=builder --chown=nextjs:nodejs /app/full/.next/static ./standalone/full/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/full/public ./standalone/full/public

CMD node ./standalone/full/server.js

We've recently updated our with-docker example. Unfortunately, we don't have the bandwidth to create examples for every permutation of package managers (each package manager, each deployment platform, each packaging mechanism, etc.).
Seeing a lot of great chatter here, though, so kudos to the group! Will close as we have examples with both pnpm and Docker, separately, and won't make one with the cross-product.

We've recently updated our with-docker example. Unfortunately, we don't have the bandwidth to create examples for every permutation of package managers (each package manager, each deployment platform, each packaging mechanism, etc.).

Nobody is asking for all that though...just pnpm package manager. Echoing @jvzaniolo, pnpm recommended and used in other examples.

For anybody looking for a solution - I was able to make it work.
I'm using TurboRepo and pnpm - and the difficulty is how pnpm and symlinks are working. Basically, pnpm stores node_modules at root level instead of package level and make references in your specific app to the packages at root level. If you want to understand, you have to look at pnpm docs and check out prune, --filter and --scope.
I wasn't able to run the Dockerfile from the app level ie. /apps/api/Dockerfile for ex. bc my Dockerfile needs to copy files such as turbo.json or pnpm-lock.yaml that are only available at root level. So I named my file like this for simplicity Dockerfile.api. I don't even know how people are able to run Dockerfile from nested apps, given that it always needs a lock (wether it's pnpm or yarn)  file and turbo.json.
Then came the Dockerfile. Basically the difficulty is handling the way pnpm downloads and reference packages in a way that's simple for my specific app, the api to have them available under node_modules.
The end goal is to have a simple folder with api/** where ** is all the necessary node_modules flattened out (ie. no symlinks, just the pure code) and the JS compiled ready to execute. Sounds simple but with monorepo, it can be tough...
So here's my code out below with explanation at each steps
# Base image with Node.js
ARG NODE_VERSION=18.18.0
# Use a specific version of the Node.js Alpine image as the base. Alpine images are minimal and lightweight.
FROM node:${NODE_VERSION}-alpine AS base
# Update the package list and install libc6-compat. This package is often required for binary Node.js modules.
RUN apk update && apk add --no-cache libc6-compat

# Setup pnpm and turbo
# Start a new stage based on the base image for setting up pnpm (a package manager) and turbo (for monorepo management).
FROM base as setup
# Install pnpm and turbo globally using npm.
RUN npm install -g pnpm turbo
# Configure pnpm to use a specific directory for storing its package cache.
RUN pnpm config set store-dir ~/.pnpm-store

# Build argument for specifying the project
# Introduce a build argument 'PROJECT' to specify which project in the monorepo to build.
ARG PROJECT=api

# Install all dependencies in the monorepo
# Start a new stage for handling dependencies. This stage uses the previously setup image with pnpm and turbo installed.
FROM setup AS dependencies
WORKDIR /app
# Copy the essential configuration files and the specific project's files into the Docker image.
COPY packages/ ./packages/
COPY turbo.json ./
COPY package.json turbo.json packages ./
COPY apps/${PROJECT} ./apps/${PROJECT}
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
# Install dependencies as per the lockfile to ensure consistent dependency resolution.
RUN pnpm install --frozen-lockfile

# Prune projects to focus on the specified project scope
# Start a new stage to prune the monorepo, focusing only on the necessary parts for the specified project.
FROM dependencies AS pruner
RUN turbo prune --scope=${PROJECT} --docker
# Remove all empty node_modules folders. This is a cleanup step to remove unnecessary directories and reduce image size.
RUN rm -rf /app/out/full/*/*/node_modules

# Build the project using turbo
# Start a new stage for building the project. This stage will compile and prepare the project for production.
FROM pruner AS builder
WORKDIR /app

# Copy pruned lockfile and package.json files
# This ensures that the builder stage has the exact dependencies needed for the project.
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=pruner /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=pruner /app/out/json/ .

# Install dependencies for the pruned project
# Utilize BuildKit's cache to speed up the dependency installation process.
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm install --frozen-lockfile

# Copy pruned source code
# Bring in the necessary source code to the builder stage for compilation.
COPY --from=pruner /app/out/full/ .

# Build with turbo and prune dev dependencies
# Use turbo to build the project, followed by pruning development dependencies to minimize the final image size.
RUN turbo build --filter=${PROJECT}...
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm prune --prod --no-optional
# Remove source files to further reduce the image size, keeping only the compiled output and necessary runtime files.
RUN rm -rf ./**/*/src

# Final production image
# Start the final stage for the production-ready image.
FROM base AS runner
# Create a non-root user and group for better security.
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nodejs
# Switch to the non-root user.
USER nodejs

WORKDIR /app
# Copy the entire app directory, including node_modules and built code. This includes all necessary runtime files.
COPY --from=builder --chown=nodejs:nodejs /app .

WORKDIR /app/apps/${PROJECT}
# Specify the command to run the application. Adjust the path as needed for your project's start script.
CMD ["npm", "run", "start"]

@nicu-chiciuc The pnpm example is working perfectly can someone guide me how can I pass the env variables to the docker images while running. I tried docker run -p 8080:8080 -e DATABASE_URL="<url-here>" web. But doesn't seem working. Though the env variable is passed to the container. I can see them when I run process.env in the node runtime in the container
This is my turbo.json
{
	"$schema": "https://turbo.build/schema.json",
	"pipeline": {
		"codegen": { "outputs": [] },
		"build": {
			"outputs": ["dist/**", ".next/**"],
			"outputMode": "new-only"
		},
		"lint": { "outputs": [], "outputMode": "errors-only" },
		"lint:fix": { "outputs": [], "outputMode": "errors-only" },
		"prettier": { "outputs": [], "outputMode": "errors-only" },
		"prettier:fix": { "outputs": [], "outputMode": "errors-only" },
		"typecheck": { "outputs": [], "outputMode": "errors-only" },
		"dev": { "cache": false, "persistent": true },
		"start": {
			"dependsOn": ["^build"],
			"cache": false,
			"persistent": true
		},
		"test:dev": { "cache": false }
	}
}

@ezhil56x
it's not clear what specifically doesn't work. You mention

I can see them when I run process.env in the node runtime

is that not the goal of passing the envs?
For my project we use docker-compose and with env_file and environment to set up the necessary env variables, so I'm not sure what happens in other scenarios.

I need to use an env like docker run .. -e

I wrote an article few months ago. It works perfectly for us.
You can check it here
https://fintlabs.medium.com/optimized-multi-stage-docker-builds-with-turborepo-and-pnpm-for-nodejs-microservices-in-a-monorepo-c686fdcf051f
Hope it will help someone 🙂

K

I wrote an article few months ago. It works perfectly for us.
You can check it here
https://fintlabs.medium.com/optimized-multi-stage-docker-builds-with-turborepo-and-pnpm-for-nodejs-microservices-in-a-monorepo-c686fdcf051f
Hope it will help someone 🙂

Have you tried running this dockerfile on GitHub actions?

Nope. I tried it with GitLab CI and locally.

I wrote an article few months ago. It works perfectly for us. You can check it here https://fintlabs.medium.com/optimized-multi-stage-docker-builds-with-turborepo-and-pnpm-for-nodejs-microservices-in-a-monorepo-c686fdcf051f Hope it will help someone 🙂

your article helped a ton. thank you for sharing !

For me it is 107 MB for a NodeJS microservice built using NestJS

I'm not sure where my issue is.
Most of the dockerfiles posted here give me 1GB images. The only one that gave me a small image was this one:

Had same problem on COPY --from=builder /app/out/full/ . line as everyone else using pnpm.
Added **/node_modules to root .dockerignore to resolve.
Then ran into issues with the last 3 COPY lines. Needed to also copy the next.config.js from the with-docker example. tldr- I was missing output: standalone
Ended up with this. I like it because pnpm and turbo are pulled to "base", allowing me to just use bare alpine in the end result. copied from the with-docker example and updated to use pnpm.
# src Dockerfile: https://github.com/vercel/turbo/blob/main/examples/with-docker/apps/web/Dockerfile
FROM node:18-alpine AS alpine

# setup pnpm on the alpine base
FROM alpine as base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN pnpm install turbo --global

FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
COPY . .
RUN turbo prune --scope=web --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
RUN pnpm install

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM

# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN

RUN turbo run build --filter=web

# use alpine as the thinest image
FROM alpine AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public

CMD node apps/web/server.js

Does anyone know why this could be happening?

Are you building a NextJS project or NodeJS? For NextJS I haven’t tried yet, but planning to create a Dockerfile and write an article.

I'm building for NextJS.
That would be great.
I guess that's the problem I just copying the whole build instead of just the NextJS built files.

Okay so I've editing this Dockerfile to work will with NextJS

I wrote an article few months ago. It works perfectly for us. You can check it here https://fintlabs.medium.com/optimized-multi-stage-docker-builds-with-turborepo-and-pnpm-for-nodejs-microservices-in-a-monorepo-c686fdcf051f Hope it will help someone 🙂

`
ARG NODE_VERSION=20
Alpine image
FROM node:${NODE_VERSION}-alpine AS alpine
RUN apk update
RUN apk add --no-cache libc6-compat
Setup pnpm and turbo on the alpine base
FROM alpine as base
RUN npm install pnpm turbo --global
RUN pnpm config set store-dir ~/.pnpm-store
Prune projects
FROM base AS pruner
ARG PROJECT
WORKDIR /app
COPY . .
RUN turbo prune --scope=${PROJECT} --docker
Build the project
FROM base AS builder
ARG PROJECT
WORKDIR /app
Copy lockfile and package.json's of isolated subworkspace
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=pruner /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=pruner /app/out/json/ .
First install the dependencies (as they change less often)
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm install --frozen-lockfile
Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .
RUN turbo build --filter=${PROJECT}
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm prune --prod --no-optional
RUN rm -rf ./**/*/src
Final image
FROM alpine AS runner
ARG PROJECT
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nodejs
USER nodejs
WORKDIR /app
COPY --from=builder --chown=nodejs:nodejs /app .
COPY --from=builder --chown=nodejs:nodejs /app/apps/${PROJECT}/next.config.js .
COPY --from=builder --chown=nodejs:nodejs /app/apps/${PROJECT}/package.json .
Automatically leverage output traces to reduce image size
https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nodejs:nodejs /app/apps/${PROJECT}/.next/standalone ./
COPY --from=builder --chown=nodejs:nodejs /app/apps/${PROJECT}/.next/static ./apps/${PROJECT}/.next/static
COPY --from=builder --chown=nodejs:nodejs /app/apps/${PROJECT}/public ./apps/${PROJECT}/public
WORKDIR /app/apps/${PROJECT}
ARG PORT=8080
ENV PORT=${PORT}
ENV NODE_ENV=production
EXPOSE ${PORT}
CMD ["node", "server.js"]
`

Also, avoid setting ENV NODE_ENV production in your Dockerfile as this also sets pnpm install to behave as pnpm install --prod which may not be what you want.

Had same problem on COPY --from=builder /app/out/full/ . line as everyone else using pnpm.
Added **/node_modules to root .dockerignore to resolve.
Then ran into issues with the last 3 COPY lines. Needed to also copy the next.config.js from the with-docker example. tldr- I was missing output: standalone
Ended up with this. I like it because pnpm and turbo are pulled to "base", allowing me to just use bare alpine in the end result. copied from the with-docker example and updated to use pnpm.
# src Dockerfile: https://github.com/vercel/turbo/blob/main/examples/with-docker/apps/web/Dockerfile
FROM node:18-alpine AS alpine

# setup pnpm on the alpine base
FROM alpine as base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN pnpm install turbo --global

FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
COPY . .
RUN turbo prune --scope=web --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
RUN pnpm install

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM

# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN

RUN turbo run build --filter=web

# use alpine as the thinest image
FROM alpine AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public

CMD node apps/web/server.js

This setup was much better than what I had before, thanks a lot! I went from 1.7GB to 185MB with this Dockerfile after making some small adjustments to make it fit my project! 🥳

output: "standalone" in next.config.js
**/node_modules in .dockerignore

My Dockerfile skills aren't great so this helped a lot! Thank you!

I've been trying to get it to work for the last few days with pnpm and standalone output in next.js.
The file-output with dive looks like this:

This is my Dockerfile:
# We run this file from the root directory (see docker:build:next command in package.json)

ARG APP_DIRNAME=next
ARG PROJECT=@foundation/next
ARG NODE_VERSION=20.11

# 1. Alpine image
FROM node:${NODE_VERSION}-alpine AS alpine
RUN apk update
RUN apk add --no-cache libc6-compat

# Setup pnpm and turbo on the alpine base
FROM alpine as base
RUN corepack enable
RUN npm install turbo --global
RUN pnpm config set store-dir ~/.pnpm-store

# 2. Prune projects
FROM base AS pruner
ARG PROJECT

WORKDIR /app
COPY . .
RUN turbo prune --scope=${PROJECT} --docker

# 3. Build the project
FROM base AS builder
ARG PROJECT

WORKDIR /app

# Copy lockfile and package.json's of isolated subworkspace
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=pruner /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=pruner /app/out/json/ .

# First install the dependencies (as they change less often)
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm install --frozen-lockfile

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .

RUN turbo build --filter=${PROJECT}
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm prune --prod --no-optional
RUN rm -rf ./**/*/src

# 4. Final image - runner stage to run the application
FROM alpine AS runner
ARG APP_DIRNAME
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 next
USER next

WORKDIR /app

COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/next.config.mjs .
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/.next/standalone ./
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/.next/static ./.next/static
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/public ./public

CMD ["node", "server.js"]

When trying to run the container i'm getting:
2024-05-27 15:37:27 node:internal/modules/cjs/loader:1145
2024-05-27 15:37:27   const err = new Error(message);
2024-05-27 15:37:27               ^
2024-05-27 15:37:27
2024-05-27 15:37:27 Error: Cannot find module 'next'
2024-05-27 15:37:27 Require stack:
2024-05-27 15:37:27 - /app/server.js
2024-05-27 15:37:27     at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
2024-05-27 15:37:27     at Module._load (node:internal/modules/cjs/loader:986:27)
2024-05-27 15:37:27     at Module.require (node:internal/modules/cjs/loader:1233:19)
2024-05-27 15:37:27     at require (node:internal/modules/helpers:179:18)
2024-05-27 15:37:27     at file:///app/server.js:22:1
2024-05-27 15:37:27     at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
2024-05-27 15:37:27     at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
2024-05-27 15:37:27     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
2024-05-27 15:37:27   code: 'MODULE_NOT_FOUND',
2024-05-27 15:37:27   requireStack: [ '/app/server.js' ]
2024-05-27 15:37:27 }
2024-05-27 15:37:27
2024-05-27 15:37:27 Node.js v20.13.1

I run the build with turbo from root like so:
(I have a remix application in this monorepo that has a very similar structure and runs perfectly like this from root)
// from root package.json
"docker:build:next": "turbo docker:build --filter=@foundation/next"

// in next-app package.json
"docker:build": "cd ../.. && docker build -t foundation/next -f apps/next/Dockerfile ."

If anyone has any idea to share how to solve this it's greatly appreciated! <3

@joakim-roos it looks like you are missing some dependencies and therefore, I guess you would have some issues when running you pnpm install.
The way I debug this is to add --no-cache and --progress=plain  to your docker build command. This will log every output of your multi staged build. From there you should see if pnpm install runs as expected.

Thanks @edouardr!
I did find the issue. The problem was that I totally forgot to copy over the node_modules dependencies so I added an extra layer which installs these and then copy over them to the final build. Here's a working version:
# We run this file from the root directory (see docker:build:next command in package.json)

ARG APP_DIRNAME=next
ARG PROJECT=@foundation/next
ARG NODE_VERSION=20.11

# 1. Alpine image
FROM node:${NODE_VERSION}-alpine AS alpine
RUN apk update
RUN apk add --no-cache libc6-compat

# Setup pnpm and turbo on the alpine base
FROM alpine as base
RUN corepack enable
RUN npm install turbo --global
RUN pnpm config set store-dir ~/.pnpm-store

# 2. Prune projects
FROM base AS pruner
ARG PROJECT

WORKDIR /app
COPY . .
RUN turbo prune --scope=${PROJECT} --docker

# 3. Build the project
FROM base AS builder
ARG PROJECT

WORKDIR /app

# Copy lockfile and package.json's of isolated subworkspace
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=pruner /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=pruner /app/out/json/ .

# First install the dependencies (as they change less often)
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm install --frozen-lockfile

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .

RUN turbo build --filter=${PROJECT}
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm prune --prod --no-optional
RUN rm -rf ./**/*/src

# 4. Production dependencies
FROM builder AS dependencies
WORKDIR /app
RUN pnpm --filter=$PROJECT deploy --prod --ignore-scripts --no-optional /dependencies

# 5. Final image - runner stage to run the application
FROM alpine AS runner
ARG APP_DIRNAME
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 next
USER next

WORKDIR /app

ENV NODE_ENV production

COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/next.config.mjs .
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/.next/standalone ./
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/.next/static ./.next/static
COPY --from=dependencies --chown=remix:nodejs /dependencies/node_modules ./node_modules
COPY --from=builder --chown=next:nodejs /app/apps/${APP_DIRNAME}/public ./public

CMD ["node", "/app/server.js"]

This setup was much better than what I had before, thanks a lot! I went from 1.7GB to 185MB with this Dockerfile after making some small adjustments to make it fit my project! 🥳

Hello, could anyone help me? I am having this problem in the running RUN turbo run build --filter=web
my dockerfile:
# src Dockerfile: https://github.com/vercel/turbo/blob/main/examples/with-docker/apps/web/Dockerfile
FROM node:18-alpine AS alpine

# setup pnpm on the alpine base
FROM alpine as base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN pnpm install turbo --global

FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
COPY . .
RUN turbo prune --scope=web --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
RUN pnpm install

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM

# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN

RUN turbo run build --filter=web

# use alpine as the thinest image
FROM alpine AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public

CMD node apps/web/server.js

so 90% of all the examples use pnpm. this happens to be the one example where an example of pnpm would add most value on account of the 30+ comments and plethora of solutions/ongoing issues now present. Any chance of this happening anytime soon?

Had same problem on COPY --from=builder /app/out/full/ . line as everyone else using pnpm.
Added **/node_modules to root .dockerignore to resolve.
Then ran into issues with the last 3 COPY lines. Needed to also copy the next.config.js from the with-docker example. tldr- I was missing output: standalone
Ended up with this. I like it because pnpm and turbo are pulled to "base", allowing me to just use bare alpine in the end result. copied from the with-docker example and updated to use pnpm.
# src Dockerfile: https://github.com/vercel/turbo/blob/main/examples/with-docker/apps/web/Dockerfile
FROM node:18-alpine AS alpine

# setup pnpm on the alpine base
FROM alpine as base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN pnpm install turbo --global

FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
COPY . .
RUN turbo prune --scope=web --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
RUN pnpm install

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM

# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN

RUN turbo run build --filter=web

# use alpine as the thinest image
FROM alpine AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public

CMD node apps/web/server.js

Using this with their with-docker example results in a ~650MB image as compared to the ~270MB one that is generated with their Dockerfile.

For those who need it, I've created a workaround with nextjs and create-t3-turbo.
You can find it on GitHub:
https://github.com/Security2431/create-t3-turbo-with-prisma/blob/main/apps/nextjs/Dockerfile
Feel free to modify it as needed to suit your own use case:
ARG NODE_VERSION=20
ARG APP_DIRNAME=nextjs
ARG PROJECT=@acme/nextjs

# 1. Alpine image
FROM node:${NODE_VERSION}-alpine AS alpine
RUN apk update
RUN apk add --no-cache libc6-compat

# Setup pnpm and turbo on the alpine base
FROM alpine AS base
RUN corepack enable
# Replace <your-major-version> with the major version installed in your repository. For example:
# RUN npm install<EMAIL_ADDRESS>--global
RUN npm install turbo --global

RUN pnpm config set store-dir ~/.pnpm-store

# 2. Prune projects
FROM base AS pruner
# https://stackoverflow.com/questions/49681984/how-to-get-version-value-of-package-json-inside-of-dockerfile
# RUN export VERSION=$(npm run version)

ARG PROJECT

# Set working directory
WORKDIR /app

# It might be the path to <ROOT> turborepo
COPY . .

# Generate a partial monorepo with a pruned lockfile for a target workspace.
# Assuming "@acme/nextjs" is the name entered in the project's package.json: { name: "@acme/nextjs" }
RUN turbo prune --scope=${PROJECT} --docker

# 3. Build the project
FROM base AS builder
ARG PROJECT

# Environment to skip .env validation on build
ENV CI=true

WORKDIR /app

# Copy lockfile and package.json's of isolated subworkspace
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=pruner /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --from=pruner /app/out/json/ .

# First install the dependencies (as they change less often)
RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm install --frozen-lockfile

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .

RUN pnpm build --filter=${PROJECT}

# 4. Final image - runner stage to run the application
FROM base AS runner
ARG APP_DIRNAME

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

WORKDIR /app

ENV NODE_ENV=production

COPY --from=builder --chown=nodejs:nextjs /app .
WORKDIR /app/apps/${APP_DIRNAME}

ARG PORT=3000
ENV PORT=${PORT}
EXPOSE ${PORT}

CMD ["pnpm", "start"]

For anyone using the example above, the COPY command is incorrect. It should be:
COPY --from=builder --chown=nextjs:nodejs /app .

The correct format is always --chown=user:group.


Fix panic on removing last entry in clientRegionCache

Codecov Report

Merging #26 into master will increase coverage by 0.15%.

@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   30.92%   31.07%   +0.15%
==========================================
  Files          22       22
  Lines        1756     1760       +4
==========================================
+ Hits          543      547       +4
  Misses       1179     1179
  Partials       34       34

Impacted Files
Coverage Δ

caches.go
74.79% <63.63%> (+0.84%)
:white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4adcc6a...59fd262. Read the comment docs.

Can probably close this since changed to use a map to hold regions: https://github.com/tsuna/gohbase/commit/e0df983025e2101c6af7c98e3efef6a4dbd1483c


Fix CLI boolean issue

This will use distutils.util.strtobool on the command line arguments ... so "false" --> False instead of "false" --> True , which matches behavior when you specify values with config file.

If you were curious, strtobool returns an int, so you have to wrap it with bool( ... I've seen others just supply functions in type to get the results you want ... I'm not sure how hacky people feel that is ...

Perfect, that's a weird bug that I overlooked. Fix looks good


Figlet hardblank update

based on discussion# 417
Hardblank is currently hard-coded as "$". This fixes that.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

*based on discussion# 441

@GianHodgson We're about to release 0.40, but we want to take this for a spin a bit in a preview version with existing applications, so I will merge this after that 👍

Merged! Thank you for your contribution. Much appreciated! 👍


Karpenter Consolidation Not Gracefully Draining Nodes, Resulting in Pod Termination and Recreation

Description
Observed Behavior: When using Karpenter with consolidation: WhenUnderutilized, nodes are not gracefully draining pods. Instead, the pods are terminated and then redeployed to new nodes. The pods' age starts from 0, indicating they are being recreated rather than being gracefully evicted and rescheduled.
Expected Behavior: Karpenter should gracefully drain the nodes by evicting the pods and rescheduling them on new nodes without terminating the pods. The pods should maintain their state and not restart from scratch.
Reproduction Steps (Please include YAML):

Create a NodePool with the following configuration:

apiVersion: karpenter.sh/v1beta1
kind: NodePool
metadata:
  name: karpenter-beta
spec:
  template:
    metadata:
      labels:
        team: devops
    spec:
      requirements:
        - key: kubernetes.io/arch
          operator: In
          values: ["arm64"]
        - key: kubernetes.io/os
          operator: In
          values: [linux]
        - key: karpenter.sh/capacity-type
          operator: In
          values: [spot]
        - key: "topology.kubernetes.io/zone"
          operator: In
          values: ["ap-south-1a", "ap-south-1b", "ap-south-1c"]
        - key: karpenter.k8s.aws/instance-category
          operator: In
          values: ["c"]
        - key: "karpenter.k8s.aws/instance-family"
          operator: In
          values: ["c6g","c7g"]
        - key: karpenter.k8s.aws/instance-generation
          operator: Gt
          values: [2]
      nodeClassRef:
        apiVersion: karpenter.k8s.aws/v1beta1
        kind: EC2NodeClass
        name: default
  limits:
    cpu: 1000
disruption:
  consolidationPolicy: WhenUnderutilized
  expireAfter: 720h # 30 * 24h = 720h

Observe the behavior when Karpenter consolidates underutilized nodes.

Versions:

Chart Version: 0.37.0
Kubernetes Version (kubectl version): 1.29

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment

https://github.com/user-attachments/assets/c7afb401-edd4-4616-8bef-c5bbb372d6c1
timestamp -> 1:19

What was the issue?

There was no issue.
Thanks.


[Parity] ActivityEx is not present in Botbuilder-Java

See dotnet source

This item is assigned to @JuanAr from Southworks. Having problems with Github at the moment.


Thank you @alberthaff for maintaining this project

This is not feature or bug requests. I am writing this to say Thank You @alberthaff  for maintaining this project :)
Love it!

Thank you @choopage, glad you like it! :-)


CARLA_0.9.5 download link not working

Hi,
I'm trying to download the CARLA_0.9.5 for linux but the download link is not working.

Try new links:
https://github.com/carla-simulator/carla/releases


[TextServer] Fix line breaks for dropcap and resizing embedded objects.

Fixes https://github.com/godotengine/godot/issues/84073
Fixes https://github.com/godotengine/godot/issues/84067

Thanks!

Fabulous! Thank you!


Less strict version of match

In a previous project I used fp-ts which has match and a less strict matchW (short for widening).
I'm not necessarily suggesting to add this (though it would be nice to have), but how would we implement this ourselves? I especially had trouble coming up with an implementation that supports both the data-first and data-last functionality.
function matchW<A, B, R, R2>(result: Result<A, B>, okFn: (value: A) => R, errorFn: (value: B) => R2): R | R2
function matchW<A, B, R, R2>(okFn: (value: A) => R, errorFn: (value: B) => R2): (result: Result<A, B>) => R | R2

The first one was pretty trivial to write, but did not manage to have one (at least clean) implementation supporting both. Is there an easy way to implement using match? Seeing an example would help me (and maybe others) understand how to implement similar helpers.

I got curious, and think I managed to come up with a generic solution. Here's an example. Feel free to close if you think matchW does not need to be part of the library, though it would be great to have IMO.

Hi. I made a PR to resolve this issue. please have a look and let me know if it's right.


[Dlight] Change max_threads on CUDA

change max number of threads per block from 256 to 1024, which makes rms_norm faster

cc: @junrushao

Given that it’s a global change, is it going to positively or negatively affect other operators on CUDA GPU?

It only affects reduction ops. Specifically, in llm, it only means rms_norm and layer_norm. So I believe it's safe to merge

Could you fix the unittests so that I could get it in?

When operator is smaller than 1024, suggest_threads_per_block will return the largest thread num that is smaller than loop extent. @Hzfengsy


Feature/overview share button

This PR creates the embed pages for the 3 different overview sections
Also, it changes the names to NDC overview section and uses hooks.
Extra:

Remove duplicated slugs in LTS

Try: Use the share buttons on the overview page

A couple of things that I'm struggling with. "Copy link" option shouldn't copy the link to the current URL? Because now it copies the embed link which is misleading. Also, I think we should include Copy embed code and Copy embed link on the overview page share modal somehow.
Overview page share modal

There is also a layout problem in the embed version of the share modal
Embed section share modal

Rest of the PR looks good & clear to me, so I'd like to clarify these issues above :point_up:

Thanks for the comments! The share layout is fixed now:

About the text on the button. For me, it makes sense to share only the part of the page that has the share button, therefore, the embedded link. We can copy the URL from the browser. @Fanny what do you think?

Thanks for the comments! The share layout is fixed now:

About the text on the button. For me, it makes sense to share only the part of the page that has the share button, therefore, the embedded link. We can copy the URL from the browser. @fannycc what do you think?

It makes sense to me!


feat(deepcast): formality

Description

better icon for switch languages action
added support for formality
added preference to show/hide formality config and transliteration
Screencast

Checklist

[x] I read the extension guidelines
[x] I read the documentation about publishing
[x] I ran npm run build and tested this distribution build in Raycast
[x] I checked that files in the assets folder are used by the extension itself
[x] I checked that assets used by the README are placed outside of the metadata folder

@mooxl can you check this?


Allow some answers to be case insensitive

All answers should be checked regardless of their case (i.e. case-insensitive).
An exception should be made for strings like flags and passwords.


New stable release - 4.5.0-0.okd-2020-09-19

Pick a nightly from Sep 19 and tag it in stable. Procedure: hackmd.io/LIK_IOnER-6kuIQWAVn5dQ?both.
Issues expected to be fixed in this release:

https://github.com/openshift/okd/issues/322

https://github.com/openshift/okd/releases/tag/4.5.0-0.okd-2020-09-18-202631


Add storage class support

This enables x-amz-storage-class support in minio-go. This is
required as Minio server is adding storage class support.
See https://github.com/minio/minio/issues/4997

{"args":{},"duration":1108,"function":"testStorageClassMetadata()","message":"Metadata match failed","name":"minio-go: testStorageClassMetadata","status":"FAIL"}
This test is expected to fail since play server doesn't support x-amz-storage-class yet.

PR is updated @harshavardhana @poornas PTAL

This is updated @harshavardhana PTAL

@harshavardhana could you please take a look on this as well

We need to update minio on play.minio.io and also what is the error that is returned when x-amz-storage-class is used with FS backend ?

what is the error that is returned when x-amz-storage-class is used with FS backend ?

x-amz-storage-class value if present in the header is not validated. Only if it matches specific values - data is erasure coded accordingly else it is ignored.

Strange then why the test fails ?

Strange then why the test fails ?

Tests failed as Play server doesn't store and respond with expected x-amz-storage-class values.


Pull/99

#99 with additional fixes

This change is

Note too, that unless your Docker image pre-creates the jenkins account (as mine did), an Alpine image will run into problems because it has adduser but not useradd.

How i like this world :)  Then need to be adopted... Will fix later...

Good catch, guys!

@gcbartlett @KostyaSha I have a question:
If some uses their own image which is not alpine based, ie there is no adduser, How do you believe we should do?
detect where we are and call the appropriate one?
What do you think we could/should do?

Yes, i think we need detect and use. In any case this JNLP launcher only one of possible way and anybody can implement their own launchers with other behaviours.  I'm busy but will try to end current enhancements and do release.

Cool. Thank you.

busybox wget doesn't support "no-check-certificate"

Correct. The image must have wget installed, to make it work.

Busybox has wget, but it has no options.

Yes, and noway to disable checking certificate with default wget from busybox. So, on Alpine, the base image must have the wget package. I fixed that in my own image by installing it with :
apk install wget -y
So, I believe we should test it and report an error to install wget to fix it. May be the ignore certificate flag help should have the information, as well. Right?

At least it may not fail under http connection that i have in test. We can also add piece of shell script into Launcher user configuration. That will allow to do manipulations before run without building image, though without logs it not very useful for debug.

yeah

But I would at least report a message in the init.sh that the wget need to be installed to make it work... So, the user know what to do.

It has wget. I will try to look again at #84 if i found the way attach logs into, it will be easier debug.

Test passed, merging.

Thanks for contribution!


VSCode built from source is unresponsive after 10s

VSCode Version: master (0d3a14402d88f0f555ab3250c3ffd4c45a251665) 1.16.0-19592-g0d3a14402d
OS Version: Ubuntu 18.04

For some reason, after building vscode from source, ./scripts/code.sh is usable for approx. 10s; after that, the window freezes. Same issue with --disable-extensions and even when disabling builtin extensions with --builtin.
Steps to Reproduce:

clone vscode repo
nvm use
yarn
yarn compile
./scripts/code.sh

I tried using ./scripts/code-cli.sh... And it works without getting stuck after 10s! :-)
For some reason, ./scripts/code.sh gets stuck

@maelvalais does it reproduce if you try the same thing from the electron-3.0.x branch? Make sure to git clean -xfd before trying.


Optimised Solver for Sudoku

    By looking at the code of the sudoku class, there are two parts generator and a solver.

I propose that we make TWO separate issues for each one, and add a generator with specific difficulty.
Regarding the solver, there are better algorithms than Backtracking, I have two candidates in my mind Dancing Links algorithm and the Rule-based Algorithm, both of them are faster than the backtracking.
This Medium article explains and Implements the Dancing Links Algorithm, and this Paper explains the Rule-based algorithm.
By looking at the two proposed algorithms it would take time to read the papers and deciding wich one to implement and as I'm still a student contributing on my weekend so, I'll do my best to make the pull request by the end of friday.
If there's another algorithm in your mind please let me know.
Originally posted by @MMostafa-Hub in https://github.com/potatochick2020/Sudoku-core/issues/3#issuecomment-1273457979

@MMostafa-Hub I am a student too, this is a really good thing that you could observe there is a part of optimised solution.
You could decide which algorithm to use.

For the time being, I don't have the time to read both articles with attention to detail and decide which one to use, but It will be done on Friday.
so by Friday, I'll implement

new SudokuSolution()
try to optimize isValid(), isPlacable(), isComplete()

Is this ok with you?

Sorry for my late reply.
Sure, let's say next Monday? No rush at all.

Can I get assigned to the issue, so that i can start working on it?


5.12.0: Cloud build trigger import fails with Trigger resource 'default' has a problem: ExactlyOne

I'm not sure what combination of things causes this issue, but for a simple (file-based) cloud function build the import fails with the following:
Diagnostics:
  gcp:cloudbuild:Trigger (default):
    error: gcp:cloudbuild/trigger:Trigger resource 'default' has a problem: ExactlyOne: "filename": one of `build,filename` must be specified. Examine values at 'Trigger.Filename'.
    error: gcp:cloudbuild/trigger:Trigger resource 'default' has a problem: ExactlyOne: "build": one of `build,filename` must be specified. Examine values at 'Trigger.Build'.
    error: gcp:cloudbuild/trigger:Trigger resource 'default' has a problem: ExactlyOne: "github": one of `github,trigger_template` must be specified. Examine values at 'Trigger.Github'.
    error: Preview failed: one or more inputs failed to validate

The configuration is as follows:
Event: push to branch
Source: github repository
Branch: regex '^development$'
Cloud build configuration file selected
Location: repository, deployment/cloudbuild.yaml
No other options are set.

I think this is the same underlying issue as https://github.com/pulumi/pulumi-gcp/issues/508. Closing in favor of that one, which also has a suggested workaround.


Add cooldown functionality

This is supposed to run as a cron. In fact if should run like this * * * * * (every minute). Because of this, the scanner doesn't get a breather and remains on until the battery runs out. We should have some sort of cooldown after 1 or all scans have been downloaded.

Suggested solution: Modify the lock file to have an expiration after a scan download has been completed. Perhaps 5 minutes, with an option to set a custom value via cli option or via a .env file variable.


fix decimal place on swap table

Description
Please include a summary of changes and related issue (if any).
Tests

[ ] Please provide evidence of your successful dbt run / dbt test here
[ ] Any comparison between prod and dev for any schema change

Checklist

[ ] Follow dbt style guide
[ ] Run git merge main to pull any changes from remote into your branch prior to merge.
[ ] Tag the person(s) responsible for reviewing proposed changes
[ ] IMPORTANT Note for deployment if a full-refresh is needed for any model this PR impacts.

If any schema is changing, whether it be a table or a view, we will need to run a full-refresh in prod to avoid errors with the scheduled refresh jobs.
The PR can be reviewed, but should not be merged unless by someone with prod access.

Tag forgxyz if a full-refresh will be required on prod.

@forgxyz  you mean round(from_amount / pow(10, adjusted_amount - raw_amount)) as from_decimal?

No, I'll tag you in Discord for context


Use the applicationContext to load the SofaRuntimeProperties

Pull Request Test Coverage Report for Build 291

8 of 12 (66.67%)  changed or added relevant lines in 2 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage increased (+0.6%) to 68.557%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

runtime-sofa-boot-starter/src/main/java/com/alipay/sofa/runtime/spring/ServiceAnnotationBeanPostProcessor.java
7
11
63.64%

Files with Coverage Reduction
New Missed Lines
%

runtime-sofa-boot-starter/src/main/java/com/alipay/sofa/runtime/spring/ServiceAnnotationBeanPostProcessor.java
1
96.05%

Totals

Change from base Build 289:
0.6%

Covered Lines:
1910

Relevant Lines:
2786

💛  - Coveralls


Cubrite vendoring and update

per @ricardotk 's suggestion in #70 :

consider vendoring Cubrite (and plugins) using submodules.
also, update Cubrite to the latest version

Submodules are awful.
I discussed with @aduermael about pinning the Cuberite version in our Dockerfile - which I think is a decent solution. We want to have control over which version of Cuberite we're vendoring.
As for plugins, I think we need a better way of managing them rather than checking them in to the repo. Ideally...
I think the right way to do this is to handle the world creation in the Dockerfile and add the Docker plugin to that world + making sure the world is empty etc...
This is more work for us, but it cleanly separates our code from Cuberite code.

but for third party libraries and plugins that we won't change I think its a decent solution too.

If we really have to do it, I'd suggest we do a subtree merge instead.

Well, we can still pin the version and use submodules (tags)

Agreed, but submodules don't give us a binary distribution which we have today in the Dockerfile. Thats bad, as we then have to bloat our image with all of the cruft required to build Cuberite.
I guess my point is that the files from Cuberite that we don't change (e.g plugins and world related things) have no place in being checked in to the repo at all either directly (like today) or as a submodule or a subtree merge.
I should have some time next week and I plan to see if we can remove the files from the repo completely and do all of the world assembly in the Dockerfile itself.

I guess my point is that the files from Cuberite that we don't change (e.g plugins and world related things) have no place in being checked in to the repo at all either directly (like today) or as a submodule or a subtree merge.

I agree

I should have some time next week and I plan to see if we can remove the files from the repo completely and do all of the world assembly in the Dockerfile itself.

That would be great :smile:


fix(material-experimental/mdc-radio): de-duplicate test harness logic

Changes the MDC-based radio harnesses to extend the base ones directly since the logic is identical, aside from some selectors.

I'm seeing the following error from this (and some of the other PRs to share harness code):
Type 'import("material/radio/testing/radio-harness").MatRadioButtonHarness[]' is not assignable to type 'import("material-experimental/mdc-radio/testing/radio-harness").MatRadioButtonHarness[]'.
  Type 'import("material/radio/testing/radio-harness").MatRadioButtonHarness' is not assignable to type 'import("material-experimental/mdc-radio/testing/radio-harness").MatRadioButtonHarness'.
    Property '_textLabel' is protected but type 'MatRadioButtonHarness' is not a class derived from 'MatRadioButtonHarness'.

I'm seeing the following error from this (and some of the other PRs to share harness code):
Type 'import("material/radio/testing/radio-harness").MatRadioButtonHarness[]' is not assignable to type 'import("material-experimental/mdc-radio/testing/radio-harness").MatRadioButtonHarness[]'.
  Type 'import("material/radio/testing/radio-harness").MatRadioButtonHarness' is not assignable to type 'import("material-experimental/mdc-radio/testing/radio-harness").MatRadioButtonHarness'.
    Property '_textLabel' is protected but type 'MatRadioButtonHarness' is not a class derived from 'MatRadioButtonHarness'.

It's odd that our own build didn't complain about it. Maybe we can flip on a compiler flag to make it behave closer to g3? Also is it possible that they're importing both the non-MDC and MDC harnesses and they're using one to type the variable and the other one to look up the elements?

It's odd that our own build didn't complain about it. Maybe we can flip on a compiler flag to make it behave closer to g3? Also is it possible that they're importing both the non-MDC and MDC harnesses and they're using one to type the variable and the other one to look up the elements?

That's what I assumed was happening at first, but no - they're not importing anything from radio/testing and the variables are explicitly typed with the class imported from mdc-radio/testing like I showed above.

That's what I assumed was happening at first, but no - they're not importing anything from radio/testing and the variables are explicitly typed with the class imported from mdc-radio/testing like I showed above.

Maybe it has something to do with the with function? this looks a little suspect:
return new HarnessPredicate<NonMdcMatRadioButtonHarness>(MatRadioButtonHarness, options)

Maybe it has something to do with the with function? this looks a little suspect:
return new HarnessPredicate<NonMdcMatRadioButtonHarness>(MatRadioButtonHarness, options)

I see, I managed to reproduce it locally too. It's only the second call that is causing the compilation error. I think that it'll have to use the same approach where we have a base class for the harnesses. I'll rework it and let you know when it's done.

I see, I managed to reproduce it locally too. It's only the second call that is causing the compilation error. I think that it'll have to use the same approach where we have a base class for the harnesses. I'll rework it and let you know when it's done.

Reworked the PR to avoid the compilation error.

Reworked the PR to avoid the compilation error.

Passes TGP - will be merged on the next round

Passes TGP - will be merged on the next round


Running tapkee

Hi there,
Thanks for a wonderful program! For some reason, I could not run 'tapkee' on my comp (OS: Windows 7). When I open the downloaded file, it, first, asks me whether I want to run the program. As I hit 'run', for a millisecond, a window appears and disappears instantly. I tried to run in the Windows console, but it says that ''tapkee' is not recognized as an internal or external command, operable program or batch file'. I wonder what I am doing wrong.

Hey! Could you provide some additional information?
For example, what downloaded file did you open, did you successfully compile the application?

Hi Fernando, thanks for your reply! Actually, the guy from the YouTube channel 'Machine Learning at Home', from where I had learnt about 'tapkee' helped to fix the problem. There was a problem with coping the downloaded file into chosen directory. Now it is solved. Thanks for getting back!


Fix memory leak in XmlObjectCore->Dispose method

I have found that unmanaged memory is not releasing after Disposing and cleaning-up everything is possible.
The problem is calling FreeHGlobal on the pointer that already is Zero
  {
      var data = Interlocked.Exchange(ref Unsafe.AsRef(**_rawByteData**), default);
      if(data != IntPtr.Zero) {
          AllocationSafety.Remove(_byteLength);
          Marshal.FreeHGlobal(**_rawByteData**);
          Unsafe.AsRef(_rawByteData) = IntPtr.Zero;
          Unsafe.AsRef(_byteLength) = 0;
          Unsafe.AsRef(_offset) = 0;
          _nodes.Dispose();
          _attributes.Dispose();
          _optional.Dispose();
          _entities.Dispose();
      }
  }

Thank you very match, this is a fatal bug.
This pull request will be merged into the develop branch. I'll merge it into the master branch soon and release the fixed version.

The PR has been merged into the master branch and now v1.0.2 has been released.
Thank you for your contribution!


[BUG]: Changing a column type from varchar to serial causes incorrect migration sql to be generated

What version of drizzle-orm are you using?
0.27.0
What version of drizzle-kit are you using?
0.19.2
Describe the Bug
Create a schema:
export const users = pgTable("users", {
  id: text("id").primaryKey(),
  name: text("name").notNull(),
});

Generate and run migration.
Alter the schema:
export const users = pgTable("users", {
  id: serial("id").primaryKey(),
  name: text("name").notNull(),
});

Generate the migration:
ALTER TABLE "users" ALTER COLUMN "id" SET DATA TYPE serial;--> statement-breakpoint

Run the migration
The following error occurs
PostgresError: type "serial" does not exist

Expected behavior
The migration is successful
Environment & setup
Linux, posgres 14

Happening to be as well on latest.

I am also getting this error when running drizzle-kit push:pg
drizzle-kit: v0.19.12
drizzle-orm: v0.27.2

error: type "serial" does not exist
    at Parser.parseErrorMessage (/node_modules/.pnpm/drizzle-kit@0.19.12/node_modules/drizzle-kit/index.cjs:40659:98)
    at Parser.handlePacket (/node_modules/.pnpm/drizzle-kit@0.19.12/node_modules/drizzle-kit/index.cjs:40500:25)
    at Parser.parse (/node_modules/.pnpm/drizzle-kit@0.19.12/node_modules/drizzle-kit/index.cjs:40424:34)
    at Socket.<anonymous> (/node_modules/.pnpm/drizzle-kit@0.19.12/node_modules/drizzle-kit/index.cjs:40700:44)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 89,
  severity: 'ERROR',
  code: '42704',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_type.c',
  line: '270',
  routine: 'typenameType'
}

Running in to the same issue, took me a while to figure out what actually happens

Running in to the same issue, took me a while to figure out what actually happens
Same thing for changing something to uuid

Figure out what happens as in there is a solution or just the error in general?

Still occurs... Any idea on how to fix it? I've tried switching to bigserial etc. but the issue is the same. It just doesn't want to generate ids past 1

Same error for us

Just ran into this - the core issue seems to be that "serial" doesn't exist as a type in postgres, serial columns are just integer columns that have as their default value the next value of a sequence.
If you create a table with a column marked as serial postgres automatically makes the sequence behind the scenes for you, but (and I think this is where drizzle is messing up) you can't just alter a table to make a given column a serial, you need to manually create the sequence and then set the default value of the column to be the next value in the sequence.
This of course runs into more potential problems, as the sequence would probably default to starting at 1, and what if there are other rows with those values, and everything might work fine at the beginning but in another 206 odd users you'll all of a sudden violate your primary key constraint because of a duplicate userid, etc. I think overall this is the type of thing where you'll probably want to write your own migration sql to make sure that everything stays consistent.
I suppose a potential fix for this would be, IF a table column is being converted from number to serial, create a sequence, set its nextval to be MAX(column)+1, set the default for that column to be the nextval of the sequence, and as long as the existing ids weren't obscenely high numbers (intified UUIDs) that might avoid most problems.