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

mlx ui pod: "EACCES: permission denied, mkdir '/workspace/build'" #337

Closed
jbusche opened this issue Jun 9, 2022 · 3 comments · Fixed by #338 or #339
Closed

mlx ui pod: "EACCES: permission denied, mkdir '/workspace/build'" #337

jbusche opened this issue Jun 9, 2022 · 3 comments · Fixed by #338 or #339
Assignees
Labels
CI/CD javascript Pull requests that update Javascript code openshift UI User Interface

Comments

@jbusche
Copy link
Contributor

jbusche commented Jun 9, 2022

Describe the bug

Trying the MLX install on my openshift cluster this am, so the steps are pretty easy

1. Have an existing cluster and be logged in, etc.
2. make sure kustomize is 3.2.0, looks good
3. clone the manifests and switch to the mlx-single-user branch
4. Run:
while ! kustomize build example | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done

I suspect my cluster needs more configuration though, after step 1, because I've got what looks like pvc permission issues, for example:

oc get pods -n kubeflow |grep ui
ml-pipeline-ui-9d7d4855d-9m78b                    1/1     Running             0          18m
mlx-ui-c47bd9f9c-qgvf6                            0/1     CrashLoopBackOff    7          18m

oc logs -f mlx-ui-c47bd9f9c-qgvf6
> aiops-frontend@0.1.0 build /workspace
> react-scripts build

Failed to compile.

EACCES: permission denied, mkdir '/workspace/build'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aiops-frontend@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the aiops-frontend@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

To Reproduce

See above

Expected behavior

Was expecting the mlx-ui pod to start successfully.

Screenshots

n/a

Environment

  • OS: Deploying from a Mac while oc logged into the OpenShift cluster
  • Browser: chrome
  • MLX Version: If the UI was up, maybe I could see the version...
  • OpenShift Version 4.8.39

Additional context

None so far, thank you!

@ckadner
Copy link
Member

ckadner commented Jun 9, 2022

Thank you @jbusche

I think @srmeier had come across this a few weeks ago and overcame the issue by adding the following to the mlx-ui Dockerfile:

RUN chgrp -R 0 /workspace && chmod -R g=u /workspace

Just doing a quick Google check on this. It seems the permissions for users running in Docker containers are at the core of this issue along with some changes in npm. There may need to be more thought given to a proper solution, like running as root or unprivileged user etc, … i.e. https://stackoverflow.com/a/45505787

@ckadner ckadner self-assigned this Jun 9, 2022
@ckadner ckadner added UI User Interface CI/CD javascript Pull requests that update Javascript code labels Jun 9, 2022
@jbusche
Copy link
Contributor Author

jbusche commented Jun 13, 2022

Noticing a problem with non-root user when deploying mlx:

oc logs -f mlx-ui-b58bb8d4c-s659j -p

> aiops-frontend@0.1.0 build /workspace
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  346.48 KB  build/static/js/2.29dd04b2.chunk.js
  56.15 KB   build/static/js/main.16e6609d.chunk.js
  3.84 KB    build/static/css/main.265e3da4.chunk.css
  2.72 KB    build/static/css/2.21151bd0.chunk.css
  780 B      build/static/js/runtime-main.b8b6e910.js

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  bit.ly/CRA-deploy


┌──────────────────────────────────────────────┐
│           npm update check failed            │
│     Try running with sudo or get access      │
│     to the local update config store via     │
│ sudo chown -R $USER:$(id -gn $USER) /.config │
└──────────────────────────────────────────────┘
/workspace/server/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:45
        throw err0
        ^

Error: EACCES: permission denied, mkdir '/workspace/sessions'
    at Object.mkdirSync (fs.js:1014:3)
    at Object.mkdirsSync (/workspace/server/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9)
    at new FileStore (/workspace/server/node_modules/session-file-store/lib/session-file-store.js:29:8)
    at initLogin (/workspace/server/dist/server.js:110:16)
    at Object.<anonymous> (/workspace/server/dist/server.js:34:5)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/workspace/sessions'
}

# oc rsh mlx-ui-b58bb8d4c-s659j
$ whoami
1000770000

oc get pods
NAME                                               READY   STATUS              RESTARTS   AGE
cache-deployer-deployment-798dc7d98b-9qtgm         1/1     Running             0          5m37s
cache-server-86f59c8696-44glh                      1/1     Running             0          5m37s
kfp-csi-s3-5btss                                   0/2     ContainerCreating   0          5m36s
kfp-csi-s3-gtw4t                                   0/2     ContainerCreating   0          5m36s
kfp-csi-s3-npj4x                                   0/2     ContainerCreating   0          5m36s
metadata-envoy-deployment-5b4856dd5-tn6jg          1/1     Running             0          5m37s
metadata-grpc-deployment-6b5685488-42zc4           1/1     Running             2          5m37s
metadata-writer-9f698fdcb-fz24w                    1/1     Running             0          5m37s
minio-5b65df66c9-7gkng                             1/1     Running             0          5m37s
ml-pipeline-77b7b79565-8jvxr                       1/1     Running             1          5m37s
ml-pipeline-persistenceagent-684f664fb7-cjw24      1/1     Running             0          5m37s
ml-pipeline-scheduledworkflow-5dfcf96788-2tzr5     1/1     Running             0          5m37s
ml-pipeline-ui-6dfcc5c664-sr6lb                    1/1     Running             0          5m37s
ml-pipeline-viewer-crd-5878c6454f-7r58q            1/1     Running             0          5m37s
ml-pipeline-visualizationserver-6876996cdd-sl5fq   1/1     Running             0          5m37s
mlx-api-7f46b6df4f-48ccr                           1/1     Running             0          5m37s
mlx-ui-b58bb8d4c-s659j                             0/1     CrashLoopBackOff    4          5m37s
mysql-f7b9b7dd4-v2dz9                              1/1     Running             0          5m37s


And then when I deleted the pod, it restarted as root user:

oc delete pod mlx-ui-b58bb8d4c-s659j
pod "mlx-ui-b58bb8d4c-s659j" deleted

oc get pods
NAME                                               READY   STATUS              RESTARTS   AGE
cache-deployer-deployment-798dc7d98b-9qtgm         1/1     Running             0          5m59s
cache-server-86f59c8696-44glh                      1/1     Running             0          5m59s
kfp-csi-s3-5btss                                   0/2     ContainerCreating   0          5m58s
kfp-csi-s3-gtw4t                                   0/2     ContainerCreating   0          5m58s
kfp-csi-s3-npj4x                                   0/2     ContainerCreating   0          5m58s
metadata-envoy-deployment-5b4856dd5-tn6jg          1/1     Running             0          5m59s
metadata-grpc-deployment-6b5685488-42zc4           1/1     Running             2          5m59s
metadata-writer-9f698fdcb-fz24w                    1/1     Running             0          5m59s
minio-5b65df66c9-7gkng                             1/1     Running             0          5m59s
ml-pipeline-77b7b79565-8jvxr                       1/1     Running             1          5m59s
ml-pipeline-persistenceagent-684f664fb7-cjw24      1/1     Running             0          5m59s
ml-pipeline-scheduledworkflow-5dfcf96788-2tzr5     1/1     Running             0          5m59s
ml-pipeline-ui-6dfcc5c664-sr6lb                    1/1     Running             0          5m59s
ml-pipeline-viewer-crd-5878c6454f-7r58q            1/1     Running             0          5m59s
ml-pipeline-visualizationserver-6876996cdd-sl5fq   1/1     Running             0          5m59s
mlx-api-7f46b6df4f-48ccr                           1/1     Running             0          5m59s
mlx-ui-b58bb8d4c-fdw8l                             1/1     Running             0          13s
mysql-f7b9b7dd4-v2dz9                              1/1     Running             0          5m59s

 oc rsh mlx-ui-b58bb8d4c-fdw8l
# exit
#### NOTE that it's root user above. (Not a "$" prompt). #####

# oc logs -f mlx-ui-b58bb8d4c-fdw8l
> aiops-frontend@0.1.0 build /workspace
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  346.48 KB  build/static/js/2.29dd04b2.chunk.js
  56.15 KB   build/static/js/main.16e6609d.chunk.js
  3.84 KB    build/static/css/main.265e3da4.chunk.css
  2.72 KB    build/static/css/2.21151bd0.chunk.css
  780 B      build/static/js/runtime-main.b8b6e910.js

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  bit.ly/CRA-deploy

[HPM] Proxy created: /  ->  http://mlx-api
Server listening at http://localhost:3000

@ckadner ckadner reopened this Jun 13, 2022
ckadner added a commit to ckadner/mlx that referenced this issue Jun 14, 2022
Closes machine-learning-exchange#337

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
ckadner added a commit to ckadner/mlx that referenced this issue Jun 14, 2022
Closes machine-learning-exchange#337

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
@ckadner
Copy link
Member

ckadner commented Jun 14, 2022

There was some good advice on resolving this issue here: nodejs/docker-node#740 (comment)

ckadner added a commit to ckadner/mlx that referenced this issue Jun 15, 2022
Closes machine-learning-exchange#337

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
mlx-bot pushed a commit that referenced this issue Jun 15, 2022
Closes #337

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
mlx-bot-app bot pushed a commit that referenced this issue Oct 28, 2022
* Add dev doc links to CONTRIBUTING.md (#312)

Resolves a task from #304

Signed-off-by: Rafael Vasquez <rafael.vasquez@ryerson.com>

* Fixes the references to latest kfctl release (#311)

Resolves a task from #304

Signed-off-by: Rafael Vasquez <rafael.vasquez@ryerson.com>

* Do not verify links in project dependencies (#320)

Resolves #319

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>

* Add navigation and description table of docs (#314)

* Create readme for docs
* Add description table to readme
* Add links to table
* update relative links
* Change documentation to document

Signed-off-by: Rafael Vasquez <rafael.vasquez@ryerson.com>

* Add script to update the docs table  (#317)


Signed-off-by: Rafael Vasquez <rafael.vasquez@ryerson.com>

* Modified the way sed version is set (#315)

Instead of checking the operating system or shell emulator,
test which version of `sed` is actually installed in the local
environment.

Resolves #301

Signed-off-by: Krishna Kumar <krishnakumar@ibm.com>

* Bump waitress from 2.0.0 to 2.1.1 in /api/server (#321)

Bumps [waitress](https://github.com/Pylons/waitress) from 2.0.0 to 2.1.1.
- [Release notes](https://github.com/Pylons/waitress/releases)
- [Changelog](https://github.com/Pylons/waitress/blob/master/CHANGES.txt)
- [Commits](Pylons/waitress@v2.0.0...v2.1.1)

---
updated-dependencies:
- dependency-name: waitress
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jupyter-server from 1.13.4 to 1.15.4 in /api/server (#324)

Bumps [jupyter-server](https://github.com/jupyter/jupyter_server) from 1.13.4 to 1.15.4.
- [Release notes](https://github.com/jupyter/jupyter_server/releases)
- [Changelog](https://github.com/jupyter-server/jupyter_server/blob/main/CHANGELOG.md)
- [Commits](jupyter-server/jupyter_server@v1.13.4...v1.15.4)

---
updated-dependencies:
- dependency-name: jupyter-server
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump minimist from 1.2.5 to 1.2.6 in /dashboard/origin-mlx (#326)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump notebook from 6.4.8 to 6.4.10 in /api/server (#327)

Bumps [notebook](http://jupyter.org) from 6.4.8 to 6.4.10.

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update API developer docs (#325)

* Add codegen workflow diagram
* Describe codegen workflow
* Describe API server package modules

Closes #325

Signed-off-by: Pavan Pss <psspavan96@gmail.com>

Co-authored-by: Christian Kadner <ckadner@us.ibm.com>

* Update UI developer docs (#323)

Closes #323

Signed-off-by: RRM123 <rithikmamidi@gmail.com>

* Correct description for make update_doc_table (#329)

Signed-off-by: ezinneanne <onwukaezinneanne@gmail.com>

* Update Kubernetes high version in deployment docs (#318) (#332)

* Add Troubleshooting section
* Limit K8s version for KIND cluster using `--image` flag

Resolves #318

Signed-off-by: Kiran-Patel <kiran.patel@ibm.com>
Signed-off-by: Kiran Patel 104844270+kiranp2396@users.noreply.github.com
Signed-off-by: Christian Kadner <ckadner@us.ibm.com>

Co-authored-by: Kiran-Patel <kiran.patel@ibm.com>
Co-authored-by: Christian Kadner <ckadner@us.ibm.com>

* fix errors in mlx-ui startup (#338)

* Run mlx-ui as non-root user (#339)

Closes #337

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>

* Update MLX setup instructions for KF 1.5 (#346)

* Update MLX setup instructions for KF 1.5

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>

* fix selected assets show up in different menus (#342)

Signed-off-by: Jiaxuan-Yang <jiaxuan.yang@ibm.com>

* Consolidate readme (#356)

Signed-off-by: Rafael Vasquez <rafael.vasquez@ryerson.com>

Signed-off-by: Rafael Vasquez <rafael.vasquez@ryerson.com>
Co-authored-by: Rafael Vasquez <rafael.vasquez@ryerson.com>

* Document MLX Models Workshop (#352)

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>

* Add GitHub action to verify doc links (#357)

Signed-off-by: Rafael Vasquez <raf.vasquez@ibm.com>

Signed-off-by: Rafael Vasquez <rafael.vasquez@ryerson.com>
Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
Signed-off-by: Krishna Kumar <krishnakumar@ibm.com>
Signed-off-by: RRM123 <rithikmamidi@gmail.com>
Signed-off-by: ezinneanne <onwukaezinneanne@gmail.com>
Signed-off-by: Jiaxuan-Yang <jiaxuan.yang@ibm.com>
Signed-off-by: Rafael Vasquez <raf.vasquez@ibm.com>
Co-authored-by: Rafael Vasquez <rafael.vasquez@ryerson.ca>
Co-authored-by: Krishna Kumar Ramachandran <krishnakumar@gatech.edu>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pavan Pss <psspavan96@gmail.com>
Co-authored-by: RRM123 <40575227+rrm123@users.noreply.github.com>
Co-authored-by: Ezinne Anne Emilia <onwukaezinneanne@gmail.com>
Co-authored-by: Kiran Patel <104844270+kiranp2396@users.noreply.github.com>
Co-authored-by: Kiran-Patel <kiran.patel@ibm.com>
Co-authored-by: jbusche <101845348+jbusche@users.noreply.github.com>
Co-authored-by: Joanna <Jiaxuan.Yang@ibm.com>
Co-authored-by: Rafael Vasquez <rafael.vasquez@ryerson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD javascript Pull requests that update Javascript code openshift UI User Interface
Projects
None yet
2 participants