Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Docker build not working (make generate-assets) #446

Open
matthiastz opened this issue Dec 28, 2022 · 4 comments
Open

Local Docker build not working (make generate-assets) #446

matthiastz opened this issue Dec 28, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@matthiastz
Copy link
Contributor

Describe the bug

Docker build / compose as described in the CONTRIBUTION guide is not working (Mac)

 > [app 6/6] RUN make generate-assets:                                                                                                                                                                        
#22 0.601 yarn run v1.22.19                                                                                                                                                                                   
#22 0.655 $ lerna run build:shared --stream                                                                                                                                                                   
#22 1.225 lerna notice cli v5.5.0                                                                                                                                                                             
#22 1.356 lerna info Executing command in 1 package: "yarn run build:shared"                                                                                                                                  
#22 1.606 @kobsio/shared: $ tsc                                                                                                                                                                               
#22 8.278 lerna success run Ran npm script 'build:shared' in 1 package in 6.9s:
#22 8.279 lerna success - @kobsio/shared
#22 8.291 $ lerna run build --stream
#22 8.636 lerna notice cli v5.5.0
#22 8.737 lerna info Executing command in 22 packages: "yarn run build"
#22 9.227 @kobsio/app: $ react-scripts build
#22 9.406 @kobsio/plugin-datadog: $ PUBLIC_URL='/plugins/datadog' react-scripts build
#22 9.495 @kobsio/plugin-azure: $ PUBLIC_URL='/plugins/azure' react-scripts build
#22 9.568 @kobsio/plugin-elasticsearch: $ PUBLIC_URL='/plugins/elasticsearch' react-scripts build
#22 9.633 @kobsio/plugin-flux: $ PUBLIC_URL='/plugins/flux' react-scripts build
#22 15.38 @kobsio/plugin-flux: Creating an optimized production build...
#22 15.44 @kobsio/plugin-elasticsearch: Creating an optimized production build...
#22 15.47 @kobsio/plugin-datadog: Creating an optimized production build...
#22 15.56 @kobsio/app: Creating an optimized production build...
#22 15.62 @kobsio/plugin-azure: Creating an optimized production build...
#22 107.7 @kobsio/app: /kobs/node_modules/@kobsio/react-scripts/scripts/build.js:19
#22 107.8 @kobsio/app:   throw err;
#22 107.8 @kobsio/app:   ^
#22 107.8 @kobsio/app: RpcIpcMessagePortClosedError: Process 259 exited [SIGKILL].
#22 107.8 @kobsio/app:     at /kobs/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:19:23
#22 107.8 @kobsio/app:     at Generator.next (<anonymous>)
#22 107.8 @kobsio/app:     at /kobs/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:8:71
#22 107.8 @kobsio/app:     at new Promise (<anonymous>)
#22 107.8 @kobsio/app:     at __awaiter (/kobs/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:4:12)
#22 107.8 @kobsio/app:     at ChildProcess.handleExit (/kobs/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:18:42)
#22 107.8 @kobsio/app:     at ChildProcess.emit (node:events:513:28)
#22 107.8 @kobsio/app:     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
#22 107.8 @kobsio/app:   code: null,
#22 107.8 @kobsio/app:   signal: 'SIGKILL'
#22 107.8 @kobsio/app: }
#22 108.1 @kobsio/app: error Command failed with exit code 1.
#22 108.1 @kobsio/app: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#22 108.3 lerna ERR! yarn run build exited 1 in '@kobsio/app'
#22 108.3 lerna WARN complete Waiting for 5 child processes to exit. CTRL-C to exit immediately.
#22 108.7 error Command failed with exit code 1.
#22 108.7 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#22 108.8 make: *** [Makefile:61: generate-assets] Error 1
------
executor failed running [/bin/sh -c make generate-assets]: exit code: 2

To Reproduce

docker build -f ./cmd/kobs/Dockerfile -t kobsio/kobs:dev . or cd deploy/docker && docker-compose up

Expected behavior

Build is working

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

node --version
v19.3.0

go version
go version go1.19.1 darwin/amd64

@matthiastz matthiastz added the bug Something isn't working label Dec 28, 2022
@matthiastz
Copy link
Contributor Author

matthiastz commented Dec 29, 2022

With docker-compose up I sometimes I also get The build failed because the process exited too early. This probably means the system ran out of memory or someone called kill -9 on the process. ... error Command failed with exit code 1.

 => CACHED [app 5/6] RUN yarn install --frozen-lockfile --network-timeout 3600000                                                                                                   0.0s
 => ERROR [app 6/6] RUN make generate-assets                                                                                                                                      214.2s
 => CANCELED [api 6/6] RUN export CGO_ENABLED=0 && make build                                                                                                                     215.3s
------                                                                                                                                                                                   
 > [app 6/6] RUN make generate-assets:                                                                                                                                                   
#22 0.490 yarn run v1.22.19                                                                                                                                                              
#22 0.608 $ lerna run build:shared --stream                                                                                                                                              
#22 1.838 lerna notice cli v5.5.0                                                                                                                                                        
#22 2.145 lerna info Executing command in 1 package: "yarn run build:shared"                                                                                                             
#22 2.468 @kobsio/shared: $ tsc                                                                                                                                                          
#22 13.56 lerna success run Ran npm script 'build:shared' in 1 package in 11.4s:
#22 13.56 lerna success - @kobsio/shared
#22 13.57 $ lerna run build --stream
#22 13.98 lerna notice cli v5.5.0
#22 14.11 lerna info Executing command in 22 packages: "yarn run build"
#22 14.62 @kobsio/app: $ react-scripts build
#22 14.67 @kobsio/plugin-elasticsearch: $ PUBLIC_URL='/plugins/elasticsearch' react-scripts build
#22 14.69 @kobsio/plugin-flux: $ PUBLIC_URL='/plugins/flux' react-scripts build
#22 14.74 @kobsio/plugin-grafana: $ PUBLIC_URL='/plugins/grafana' react-scripts build
#22 14.75 @kobsio/plugin-datadog: $ PUBLIC_URL='/plugins/datadog' react-scripts build
#22 14.80 @kobsio/plugin-github: $ PUBLIC_URL='/plugins/github' react-scripts build
#22 14.87 @kobsio/plugin-azure: $ PUBLIC_URL='/plugins/azure' react-scripts build
#22 14.92 @kobsio/plugin-istio: $ PUBLIC_URL='/plugins/istio' react-scripts build
#22 14.94 @kobsio/plugin-jaeger: $ PUBLIC_URL='/plugins/jaeger' react-scripts build
#22 14.97 @kobsio/plugin-helm: $ PUBLIC_URL='/plugins/helm' react-scripts build
#22 14.97 @kobsio/plugin-harbor: $ PUBLIC_URL='/plugins/harbor' react-scripts build
#22 15.01 @kobsio/plugin-jira: $ PUBLIC_URL='/plugins/jira' react-scripts build
#22 23.71 @kobsio/plugin-jira: Creating an optimized production build...
#22 23.90 @kobsio/plugin-helm: Creating an optimized production build...
#22 23.99 @kobsio/plugin-harbor: Creating an optimized production build...
#22 24.08 @kobsio/plugin-istio: Creating an optimized production build...
#22 24.10 @kobsio/plugin-flux: Creating an optimized production build...
#22 24.29 @kobsio/plugin-datadog: Creating an optimized production build...
#22 24.34 @kobsio/plugin-jaeger: Creating an optimized production build...
#22 24.38 @kobsio/app: Creating an optimized production build...
#22 24.58 @kobsio/plugin-github: Creating an optimized production build...
#22 24.62 @kobsio/plugin-azure: Creating an optimized production build...
#22 24.65 @kobsio/plugin-grafana: Creating an optimized production build...
#22 24.88 @kobsio/plugin-elasticsearch: Creating an optimized production build...
#22 209.0 @kobsio/plugin-harbor: The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
#22 210.0 @kobsio/plugin-harbor: error Command failed with exit code 1.
#22 210.0 @kobsio/plugin-harbor: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#22 211.4 lerna ERR! yarn run build exited 1 in '@kobsio/plugin-harbor'
#22 211.4 lerna WARN complete Waiting for 12 child processes to exit. CTRL-C to exit immediately.
#22 213.1 error Command failed with exit code 1.
#22 213.1 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#22 213.4 make: *** [Makefile:61: generate-assets] Error 1
------
executor failed running [/bin/sh -c make generate-assets]: exit code: 2
ERROR: Service 'kobs-satellite' failed to build : Build failed

@matthiastz
Copy link
Contributor Author

matthiastz commented Dec 29, 2022

I also tried increasing memory, e.g. with node --max-old-space-size=8000, but no luck.
Also I can not really see a process consuming lots of memory, e.g. when analyzing system resource usage via htop.

@matthiastz
Copy link
Contributor Author

matthiastz commented Dec 29, 2022

I found a temporary workaround, to at least work on the klogs plugin:

add

	plugins = []plugin.Instance{
		{
			ID:              "/satellite/dev-de1/type/klogs/name/klogs",
			Satellite:       "b",
			Name:            "klogs",
			Description:     "klogs",
			Type:            "klogs",
			Options:         nil,
			FrontendOptions: nil,
			UpdatedAt:       1337,
		},
	}

to plugins.go L31,

adapt address: http://localhost:15221 in deploy/docker/kobs/hub.yaml

make build
./bin/kobs satellite --log.level=debug --satellite.config=deploy/docker/kobs/satellite.yaml --satellite.token=unsecuretoken
./bin/kobs hub --log.level=debug --hub.config=deploy/docker/kobs/hub.yaml --app.assets=./bin/app
yarn workspace @kobsio/app start --> localhost:3000

@matthiastz
Copy link
Contributor Author

matthiastz commented Dec 21, 2023

since the setup got heavily changed in #454 I think we can close this.
the issue is still the same tho, its not transparent how to setup a local dev environment without heavily working into to code and changing scripts, make or docker files etc.

the CONTRIBUTION guide is also outdated and can not be used (both backend and frontend)

see also: #607

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

No branches or pull requests

1 participant