#How slow/fast is Dagger ?

1 messages · Page 1 of 1 (latest)

vapid solar
#

Hi, this is my first try to setup dagger. I start from this project with two tech (fastapi + nextjs)

https://vercel.com/templates/next.js/nextjs-fastapi-starter

I want to build the two image with tests, etc.

  1. Init with dagger init --sdk=python
  2. Create install step
class NextjsFastapi:
    @function
    async def install(self, source: dagger.Directory) -> dagger.Directory:
        """Install dependencies"""
        return (
            dag.container()
            .from_("node:18-alpine")
            .with_directory("/src", source)
            .with_workdir("/src")
            .with_exec(["npm", "install"])
            .directory("/src")
        )```
3. run install 
dagger call install --source=.

It is still running after 5 minutes. it is stall at this point : 
    source: ✔ ModuleSource.resolveDirectoryFromCaller(path: "."): Directory!

Simple Next.js boilerplate that uses FastAPI as the API backend.

split summit
#

Hey! I am trying to reproduce this on my end

#

It took 42 seconds total for me -- so somethign def feels off

Could you tell us more about your setup? Which OS, are you using Docker? Are you calling this from within the nextjs-fastapi directory?

vapid solar
#

ubuntu

#

I am calling it from the root

split summit
#

root being nextjs-fastapi?

vapid solar
#

yes

#

where I initiate also dagger

split summit
#

Did you happen to run npm install as well outide of dagger?

Main reason I ask is when you call this function you are going to sync every directory into the container so if there is a bunch of stuff in there it may explain some slowness

vapid solar
#

Also I also try the exemple from the documentation :

@function
def build_env(self, source: dagger.Directory) -> dagger.Container:
    """Build a ready-to-use development environment"""
    node_cache = dag.cache_volume("node")
    return (
        dag.container()
        .from_("node:21-slim")
        .with_directory("/src", source)
        .with_mounted_cache("/src/node_modules", node_cache)
        .with_workdir("/src")
        .with_exec(["npm", "install"])
    )

and it is more than 10m and not finished

split summit
#

Yeah something is def wrong

#

Do you wanna pair for a bit on a screenshare?

vapid solar
#

Ok

#

There is swapping ?

split summit
#

Are you running Docker on Ubuntu, if so, how much memory and disk did you give it?

vapid solar
#

yes it is docker

#

standard ?

#

I didn't touch any config

split summit
split summit
#

Hey @vapid solar can you also please share the entire output of docker info with me here?

#

@grim gale if you have a min, this is hanging on ubuntu and its not clear why, any ideas?

Here's a bunch of logs but nothing jumps out at me

#

I am running on Ubuntu myself now, and even with node_modules not being ignored it still only takes about a minute. :/

grim gale
#

👋 checking this now @split summit @vapid solar