Open TomGranot opened 5 years ago
@oblador When you get a sec, I know you're probably super busy:)
@tomgs Could you try upgrading to latest and adding the --chromeDockerWithoutSeccomp
flag to the loki command?
I have the same issue, and --chromeDockerWithoutSeccomp does not resolve it.
@oblador Haven't gotten around to testing it yet, but I do remember trying with the flag (and the latest version), and having it fail. Will let you know once I get around to it again.
@tomgs did you resolve your issue here?
Any luck on this? It's blocking me as well.
I resorted to just switching my CI job to (run test || run test). It never seems to fail twice in a row, so every now and then the tests take a couple extra minutes to run.
It’s not ideal, but it works.
On Tue, Jan 21, 2020 at 6:18 AM Simon Prochazka notifications@github.com wrote:
Any luck on this? It's blocking me as well.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/oblador/loki/issues/148?email_source=notifications&email_token=AABX4GKYSOLX6AUKKDPDDBTQ63KZTA5CNFSM4HRJFWJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJPMRXY#issuecomment-576637151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABX4GPJN5KWH4GPYEC54WDQ63KZTANCNFSM4HRJFWJA .
No luck with that in Gitlab CI.
Haven't gotten around to taking a look at it since then, will update once I do.
I had the same error on GitLab CI with socket binding for dind. Inspired by the solution described here I finally managed to run Loki with built storybook, but unfortunately it wasn't without patching Loki's source code (by patch-package in postinstall
hook, but yarn2 has the same functionality from the box afaik). The solution is based on GitLab's environment variables, and I'm not sure this can (or should) be transformed to something generic.
```patch diff --git a/node_modules/loki/src/targets/chrome/docker.js b/node_modules/loki/src/targets/chrome/docker.js index 6553433..2102710 100644 --- a/node_modules/loki/src/targets/chrome/docker.js +++ b/node_modules/loki/src/targets/chrome/docker.js @@ -106,10 +106,16 @@ function createChromeDockerTarget({ dockerUrl = baseUrl.replace('localhost', ip); } else if (baseUrl.indexOf('file:') === 0) { const staticPath = baseUrl.substr('file:'.length); - const staticMountPath = '/var/loki'; - runArgs.push('-v'); - runArgs.push(`${staticPath}:${staticMountPath}`); - dockerUrl = `file://${staticMountPath}`; + + if (process.env.CI) { + // In CI environment the fs is inherited from the parent container + dockerUrl = `file://${staticPath}`; + } else { + const staticMountPath = '/var/loki'; + runArgs.push('-v'); + runArgs.push(`${staticPath}:${staticMountPath}`); + dockerUrl = `file://${staticMountPath}`; + } } async function getIsImageDownloaded(imageName) { @@ -133,10 +139,36 @@ function createChromeDockerTarget({ } } + async function getParentContainerId(jobId) { + const { code, stdout, stderr } = await execa(dockerPath, [ + 'ps', + '-q', + '-f', + `label=com.gitlab.gitlab-runner.job.id=${jobId}` + ]); + + if (code !== 0) { + throw new Error(`Failed getting parent container id, ${stderr}`); + } + + return stdout.trim(); + } + async function start() { port = await getRandomPort(); ensureDependencyAvailable('docker'); + + if (process.env.CI) { + const jobId = process.env.CI_JOB_ID; + const parentContainerId = await getParentContainerId(jobId); + + debug(`CI environment job id - ${jobId}, parent container id - ${parentContainerId}`); + + runArgs.push('--volumes-from'); + runArgs.push(parentContainerId); + } + const args = runArgs .concat([ '--shm-size=1g', ```
I build storybook, and run loki --reactUri file:./build-storybook, it not working, What caused this?
I had the same problems and it was due to erroneous requests to statics (styles, web fonts), after I removed and corrected them, the loki began to run normally, same for pre-builded case with storybook-static
I had the same problems and it was due to erroneous requests to statics (styles, web fonts), after I removed and corrected them, the loki began to run normally, same for pre-builded case with storybook-static
Hello, please tell me how you did it? Much needed, thank you!
I had the same problems and it was due to erroneous requests to statics (styles, web fonts), after I removed and corrected them, the loki began to run normally, same for pre-builded case with storybook-static
Hello, please tell me how you did it? Much needed, thank you!
I ran into the same issue. It is really about missing static assets and it looks like Loki is hiding the issue during runtime: https://github.com/oblador/loki/blob/master/packages/core/src/create-static-server.js#L48
You must edit the source of the Loki (node_modules\@loki\core\src\create-static-server.js) to log all the errors and to see the problematic files
I had the same problems and it was due to erroneous requests to statics (styles, web fonts), after I removed and corrected them, the loki began to run normally, same for pre-builded case with storybook-static
Hello, please tell me how you did it? Much needed, thank you!
I ran into the same issue. It is really about missing static assets and it looks like Loki is hiding the issue during runtime: https://github.com/oblador/loki/blob/master/packages/core/src/create-static-server.js#L48
You must edit the source of the Loki (node_modules@loki\core\src\create-static-server.js) to log all the errors and to see the problematic files
Please tell me how to do this?
I'm getting
Failed fetching stories because the server is down
with a staticstorybook
build. Basically, I've got this line in mypackage.json
, which I run usingnpm run test:visual-static-storybook
:This is of course only runs after I do
build-storybook
.Some extra data:
ubuntu-16.04-docker-17.12.0-ce-standard
).Things I've tried:
$PWD
in thestorybook
path, i.e,file:./storybook
andfile:$PWD/storybook
.--headless
and--no-sandbox
chrome flags.storybook
indeed fills up that folder.Issues I've consulted: https://github.com/oblador/loki/issues/85 https://github.com/oblador/loki/issues/142 https://github.com/oblador/loki/issues/143