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

tmp nodeshift configuration #646

Open
pacostas opened this issue May 31, 2022 · 4 comments
Open

tmp nodeshift configuration #646

pacostas opened this issue May 31, 2022 · 4 comments

Comments

@pacostas
Copy link
Member

pacostas commented May 31, 2022

Loggin in with nodeshift first to an openshift sandbox instance and then to a local openshift isntance, results to nodeshift while deploying an app, deploying it to sandbox instance instead of local instance.
In order to resolve this issue, and manage to deploy my app on local instance, had to remove tmp directory located on the root directory of my app and rerun the nodeshift login command.
If that is the right behavior of nodeshift, I think it should be documented

@helio-frota
Copy link
Member

helio-frota commented Aug 22, 2022

great for report this situation I never switched between local and sandbox to check that

@helio-frota
Copy link
Member

helio-frota commented Sep 15, 2022

nodeshift is working for me when I run oc logout from the sandbox

nodejs-rest-http-crud git:(main) oc logout
Logged "heliofrota" out on "https://api.sandbox.x8i5.p1.openshiftapps.com:6443"
➜  nodejs-rest-http-crud git:(main) oc login -u developer https://api.crc.testing:6443
Logged into "https://api.crc.testing:6443" as "developer" using existing credentials.

You don't have any projects. You can try to create a new project, by running

    oc new-project <projectname>

➜  nodejs-rest-http-crud git:(main) oc new-project foobar
Now using project "foobar" on server "https://api.crc.testing:6443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app rails-postgresql-example

to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:

    kubectl create deployment hello-node --image=k8s.gcr.io/e2e-test-images/agnhost:2.33 -- /agnhost serve-hostname

➜  nodejs-rest-http-crud git:(main) npm install

up to date, audited 844 packages in 6s

106 packages are looking for funding
  run `npm fund` for details

5 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
➜  nodejs-rest-http-crud git:(main) oc new-app -e POSTGRESQL_USER=luke -ePOSTGRESQL_PASSWORD=secret -ePOSTGRESQL_DATABASE=my_data centos/postgresql-10-centos7 --name=my-database
--> Found container image ecc4d3f (13 months old) from Docker Hub for "centos/postgresql-10-centos7"

    PostgreSQL 10 
    ------------- 
    PostgreSQL is an advanced Object-Relational database management system (DBMS). The image contains the client and server programs that you'll need to create, run, maintain and access a PostgreSQL DBMS server.

    Tags: database, postgresql, postgresql10, rh-postgresql10

    * An image stream tag will be created as "my-database:latest" that will track this image

--> Creating resources ...
    imagestream.image.openshift.io "my-database" created
Warning: would violate PodSecurity "restricted:v1.24": allowPrivilegeEscalation != false (container "my-database" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "my-database" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "my-database" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "my-database" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
    deployment.apps "my-database" created
    service "my-database" created
--> Success
    Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
     'oc expose service/my-database' 
    Run 'oc status' to view your app.
➜  nodejs-rest-http-crud git:(main) npm run openshift

> nodejs-rest-http-crud@4.0.0 openshift
> nodeshift --dockerImage=registry.access.redhat.com/ubi8/nodejs-16

2022-09-15T08:58:57.461Z INFO loading configuration
2022-09-15T08:58:57.464Z INFO No login.json file found
2022-09-15T08:58:57.476Z INFO using namespace foobar at https://api.crc.testing:6443
2022-09-15T08:58:57.477Z INFO creating archive of package.json, app.js, tracer.js, public, bin, lib, LICENSE
2022-09-15T08:58:57.511Z INFO creating build configuration nodejs-rest-http-crud-s2i
2022-09-15T08:58:57.511Z INFO Using the Source Build Strategy
2022-09-15T08:58:57.511Z INFO Using s2i image registry.access.redhat.com/ubi8/nodejs-16 with tag latest
2022-09-15T08:58:57.550Z INFO creating ImageStream nodejs-rest-http-crud
2022-09-15T08:58:57.558Z INFO uploading binary archive /home/heliofrota/code/nodejs-rest-http-crud/tmp/nodeshift/build/archive.tar
2022-09-15T08:59:01.365Z INFO binary upload complete
2022-09-15T08:59:01.366Z INFO waiting for build to finish
2022-09-15T08:59:04.422Z TRACE time="2022-09-15T08:59:03Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
2022-09-15T08:59:04.422Z TRACE I0915 08:59:03.627687       1 defaults.go:102] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on].
2022-09-15T08:59:04.423Z TRACE Caching blobs under "/var/cache/blobs".
2022-09-15T08:59:04.423Z TRACE Trying to pull registry.access.redhat.com/ubi8/nodejs-16:latest...
2022-09-15T08:59:06.708Z TRACE Getting image source signatures
2022-09-15T08:59:07.208Z TRACE Copying blob sha256:1b3417e31a5e0e64f861e121d4efed3152e75aaa85026cd784cd0070e063daa3
2022-09-15T08:59:07.405Z TRACE Copying blob sha256:36bead343ed7bbdf6c0b72c3914b13a81201e129d6e8365d42c23a1d85bbe03c
2022-09-15T08:59:07.864Z TRACE Copying blob sha256:a1aa36eeeefc5a6860145b54527fbcdedcab987537c5504dc54bdedf25e7196d
2022-09-15T08:59:07.911Z TRACE Copying blob sha256:809fe483e88523e7021d76b001a552856f216430023bdc0aeff8fce8df385535
2022-09-15T08:59:15.137Z TRACE Copying config sha256:0ffebd6de0e2dcb0da2241710a7c6a43b6f6864fef3b285600a47ece962c0179
2022-09-15T08:59:15.174Z TRACE Writing manifest to image destination
2022-09-15T08:59:15.190Z TRACE Storing signatures
2022-09-15T08:59:21.990Z TRACE Generating dockerfile with builder image registry.access.redhat.com/ubi8/nodejs-16:latest
2022-09-15T08:59:21.990Z TRACE 
2022-09-15T08:59:21.994Z TRACE Adding transient rw bind mount for /run/secrets/rhsm
2022-09-15T08:59:21.994Z TRACE 
2022-09-15T08:59:21.995Z TRACE STEP 1/9: FROM registry.access.redhat.com/ubi8/nodejs-16:latest
2022-09-15T08:59:22.079Z TRACE STEP 2/9: LABEL "io.openshift.build.image"="registry.access.redhat.com/ubi8/nodejs-16:latest"       "io.openshift.build.source-location"="/tmp/build/inputs"
2022-09-15T08:59:22.103Z TRACE STEP 3/9: ENV OPENSHIFT_BUILD_NAME="nodejs-rest-http-crud-s2i-1"     OPENSHIFT_BUILD_NAMESPACE="foobar"
2022-09-15T08:59:22.126Z TRACE STEP 4/9: USER root
2022-09-15T08:59:22.153Z TRACE STEP 5/9: COPY upload/src /tmp/src
2022-09-15T08:59:22.365Z TRACE STEP 6/9: RUN chown -R 1001:0 /tmp/src
2022-09-15T08:59:22.776Z TRACE STEP 7/9: USER 1001
2022-09-15T08:59:22.799Z TRACE STEP 8/9: RUN /usr/libexec/s2i/assemble
2022-09-15T08:59:23.108Z TRACE ---> Installing application source ...
2022-09-15T08:59:23.119Z TRACE ---> Installing all dependencies
2022-09-15T09:01:26.564Z TRACE npm WARN deprecated har-validator@5.1.5: this library is no longer supported
2022-09-15T09:01:28.497Z TRACE npm WARN
2022-09-15T09:01:28.497Z TRACE deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
2022-09-15T09:01:36.060Z TRACE npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
2022-09-15T09:01:38.399Z TRACE npm WARN deprecated @opentelemetry/sdk-metrics-base@0.29.2: Please use @opentelemetry/sdk-metrics
2022-09-15T09:01:42.378Z TRACE 
2022-09-15T09:01:42.378Z TRACE added 824 packages, and audited 825 packages in 2m
2022-09-15T09:01:42.378Z TRACE 
2022-09-15T09:01:42.378Z TRACE 107 packages are looking for funding
2022-09-15T09:01:42.378Z TRACE run `npm fund` for details
2022-09-15T09:01:42.388Z TRACE 
2022-09-15T09:01:42.389Z TRACE 5 moderate severity vulnerabilities
2022-09-15T09:01:42.389Z TRACE 
2022-09-15T09:01:42.389Z TRACE To address all issues (including breaking changes), run:
2022-09-15T09:01:42.389Z TRACE npm audit fix --force
2022-09-15T09:01:42.389Z TRACE 
2022-09-15T09:01:42.389Z TRACE Run `npm audit` for details.
2022-09-15T09:01:42.389Z TRACE npm notice
2022-09-15T09:01:42.389Z TRACE npm notice New minor version of npm available! 8.11.0 -> 8.19.2
2022-09-15T09:01:42.389Z TRACE npm
2022-09-15T09:01:42.389Z TRACE notice Changelog: <https://github.com/npm/cli/releases/tag/v8.19.2>
2022-09-15T09:01:42.390Z TRACE npm notice Run `npm install -g npm@8.19.2` to update!
2022-09-15T09:01:42.390Z TRACE npm notice
2022-09-15T09:01:42.420Z TRACE ---> Building in production mode
2022-09-15T09:01:43.370Z TRACE ---> Pruning the development dependencies
2022-09-15T09:01:45.780Z TRACE 
2022-09-15T09:01:45.781Z TRACE up to date, audited 220 packages in 2s
2022-09-15T09:01:45.781Z TRACE 
2022-09-15T09:01:45.781Z TRACE 13 packages are looking for funding
2022-09-15T09:01:45.781Z TRACE run `npm fund` for details
2022-09-15T09:01:45.782Z TRACE 
2022-09-15T09:01:45.782Z TRACE found 0 vulnerabilities
2022-09-15T09:01:46.071Z TRACE /tmp is not a mountpoint
2022-09-15T09:01:46.072Z TRACE ---> Cleaning the /tmp/npm-*
2022-09-15T09:01:46.342Z TRACE /opt/app-root/src/.npm is not a mountpoint
2022-09-15T09:01:46.342Z TRACE ---> Cleaning the npm cache /opt/app-root/src/.npm
2022-09-15T09:01:46.897Z TRACE STEP 9/9: CMD /usr/libexec/s2i/run
2022-09-15T09:01:46.929Z TRACE COMMIT temp.builder.openshift.io/foobar/nodejs-rest-http-crud-s2i-1:3f4296ed
2022-09-15T09:01:48.645Z TRACE Getting image source signatures
2022-09-15T09:01:48.646Z TRACE Copying blob sha256:b38cb92596778e2c18c2bde15f229772fe794af39345dd456c3bf6702cc11eef
2022-09-15T09:01:48.647Z TRACE Copying blob sha256:23e15b9ab3f0ef87e5fd30f1ce0fb91d39ceea2d903dce104620a24a5a551b77
2022-09-15T09:01:48.647Z TRACE Copying blob sha256:5863c9bfd6aff8171d8b37cb09cbcf77ec0228f0b0acd7eaf69f561882217284
2022-09-15T09:01:48.648Z TRACE Copying blob sha256:409181864706ab3506377284594b78ae924c62c8cdcf1309b6ec74f887c3d5eb
2022-09-15T09:01:48.648Z TRACE Copying blob sha256:f4b004828a60f7601c526d8c2a100d0f2ac337716aecc9de0cff2ea6cebde6cb
2022-09-15T09:01:48.995Z TRACE Copying config sha256:d1db1bedcd68e3f27c6f13d17cdd97fb0c2533c1fed0c5f8e341e4943a0dcecd
2022-09-15T09:01:49.030Z TRACE Writing manifest to image destination
2022-09-15T09:01:49.042Z TRACE Storing signatures
2022-09-15T09:01:50.206Z TRACE --> d1db1bedcd6
2022-09-15T09:01:50.207Z TRACE Successfully tagged temp.builder.openshift.io/foobar/nodejs-rest-http-crud-s2i-1:3f4296ed
2022-09-15T09:01:50.552Z TRACE d1db1bedcd68e3f27c6f13d17cdd97fb0c2533c1fed0c5f8e341e4943a0dcecd
2022-09-15T09:01:50.562Z TRACE 
2022-09-15T09:01:50.563Z TRACE Pushing image image-registry.openshift-image-registry.svc:5000/foobar/nodejs-rest-http-crud:latest ...
2022-09-15T09:01:50.564Z TRACE Getting image source signatures
2022-09-15T09:01:50.621Z TRACE Copying blob sha256:a1aa36eeeefc5a6860145b54527fbcdedcab987537c5504dc54bdedf25e7196d
2022-09-15T09:01:50.627Z TRACE Copying blob sha256:1b3417e31a5e0e64f861e121d4efed3152e75aaa85026cd784cd0070e063daa3
2022-09-15T09:01:50.633Z TRACE Copying blob sha256:809fe483e88523e7021d76b001a552856f216430023bdc0aeff8fce8df385535
2022-09-15T09:01:50.634Z TRACE Copying blob sha256:36bead343ed7bbdf6c0b72c3914b13a81201e129d6e8365d42c23a1d85bbe03c
2022-09-15T09:01:50.634Z TRACE Copying blob sha256:f4b004828a60f7601c526d8c2a100d0f2ac337716aecc9de0cff2ea6cebde6cb
2022-09-15T09:01:51.942Z TRACE Copying config sha256:d1db1bedcd68e3f27c6f13d17cdd97fb0c2533c1fed0c5f8e341e4943a0dcecd
2022-09-15T09:01:52.130Z TRACE Writing manifest to image destination
2022-09-15T09:01:52.197Z TRACE Storing signatures
2022-09-15T09:01:52.197Z TRACE Successfully pushed image-registry.openshift-image-registry.svc:5000/foobar/nodejs-rest-http-crud@sha256:483f97a6e6b63c9ff89fe16bcbce3ac2d786ccc7df2228004685e5f0f1aceaab
2022-09-15T09:01:52.212Z TRACE Push successful
2022-09-15T09:02:02.494Z INFO build nodejs-rest-http-crud-s2i-1 complete
2022-09-15T09:02:02.506Z INFO openshift.yaml and openshift.json written to /home/heliofrota/code/nodejs-rest-http-crud/tmp/nodeshift/resource/
2022-09-15T09:02:02.513Z INFO creating new secret my-database-secret
2022-09-15T09:02:02.516Z INFO creating new service nodejs-rest-http-crud
2022-09-15T09:02:02.517Z INFO creating new route nodejs-rest-http-crud
2022-09-15T09:02:02.517Z INFO creating deployment configuration nodejs-rest-http-crud
2022-09-15T09:02:02.530Z INFO route host mapping nodejs-rest-http-crud-foobar.apps-crc.testing
2022-09-15T09:02:02.563Z INFO complete
⏎                                                                                                                                   ➜  nodejs-rest-http-crud git:(main)         oc new-app -e POSTGRESQL_USER=luke -ePOSTGRESQL_PASSWORD=secret -ePOSTGRESQL_DATABASE=my_data centos/p…
➜  nodejs-rest-http-crud git:(main) oc get svc
NAME                    TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
my-database             ClusterIP   10.217.5.171   <none>        5432/TCP   4m47s
nodejs-rest-http-crud   ClusterIP   10.217.4.56    <none>        8080/TCP   32s

@pacostas
Copy link
Member Author

@helio-frota On your example you demonstrate using the oc client, which I can also validate that it work. Did you switch between local and sandbox openshift with nodeshift client?

@helio-frota
Copy link
Member

helio-frota commented Sep 15, 2022

@pacostas oh now I got it, you mean the nodeshift login feature.

Did you switch between local and sandbox openshift with nodeshift client?

No I just used the oc command.

thanks for the extra clarification 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants