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

How to work with meteor projects? #392

Closed
dtodt opened this issue Feb 17, 2016 · 20 comments
Closed

How to work with meteor projects? #392

dtodt opened this issue Feb 17, 2016 · 20 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.

Comments

@dtodt
Copy link

dtodt commented Feb 17, 2016

Greetings.

I'm trying to develop over Meteor 1.3 which is on Beta, my default dev workspace is on windows 10, but that meteor beta is not accepting windows environments yet.

Che is my way through this wall. That probably can be done, but I'm not a expert on linux or even on docker, my custom environment is not working as expected.

I get the node stack dockerfile, and made some changes, here it is:

FROM codenvy/debian_jre
ENV NODE_VERSION=5.6.0 \
    NODE_PATH=/usr/local/lib/node_modules

RUN sudo apt-get update && \
    sudo apt-get -y install build-essential libssl-dev libkrb5-dev gcc make ruby-full rubygems && \
    sudo gem install sass compass && \
    sudo apt-get clean && \
    sudo apt-get -y autoremove && \
    sudo apt-get -y clean && \
    sudo rm -rf /var/lib/apt/lists/* && \
    set -ex \
    && for key in \
      9554F04D7259F04124DE6B476D5A82AC7E37093B \
      94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
      0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \
      FD3A5288F042B6850C66B31F09FE44734EB7990E \
      71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
      DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
    ; do \
      gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
    done && \
    cd /home/user && curl --insecure -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
    && curl --insecure -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
    && gpg --verify SHASUMS256.txt.asc \
    && grep "node-v$NODE_VERSION-linux-x64.tar.gz\$" SHASUMS256.txt.asc | sha256sum -c - \
    && sudo tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
    && sudo rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc

EXPOSE 3000 5000 9000
RUN sudo npm install -g rimraf npm-check-updates cordova ionic
RUN curl https://install.meteor.com/ | sh

CMD tail -f /dev/null

After run that custom workspace, when I try to create a Meteor project, I receive a bunch of locale fail warnings.
Even after managed to install the locales dependency, I cant run the project, is something that I'm missing I guess.

@TylerJewell TylerJewell added status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. kind/question Questions that haven't been identified as being feature requests or bugs. labels Feb 18, 2016
@ghost
Copy link

ghost commented Feb 18, 2016

FROM codenvy/node
RUN sudo npm install -g rimraf npm-check-updates cordova ionic
RUN curl https://install.meteor.com/ | sh &&
sudo apt-get update && sudo apt-get install locales -y &&
locale-gen en_US.UTF-8 &&
sudo localedef -i en_GB -f UTF-8 en_US.UTF

When in a workspace, open a terminal:

cd /projects meteor create simple-todo

Then click Refresh button on the project explorer panel, you will see your new project. Double click on it. Configure as Blank.

In the CMD command widget define a new command and its preview URL:

Command:
cd ${current.project.path} meteor

Preview URL: ${server.port.3000}

meteor

I followed meteor official guide.

We'll publish a detailed meteor tutorial in Che docs.

@dtodt
Copy link
Author

dtodt commented Feb 18, 2016

Thanks for the help. 👍

But when I created this issue, my project did not start, breaking on mongo start, first with returnCode 1 then with returnCode 45.

I'll try again when I get home.

The image "codenvy/node" has a 0.12 node version, how do I update this to the 5.6 ?

@ghost
Copy link

ghost commented Feb 18, 2016

Inherit from codenvy/ubuntu_jre and build any stack you want.

@dtodt
Copy link
Author

dtodt commented Feb 19, 2016

I try your command:
image

@ghost
Copy link

ghost commented Feb 19, 2016

RUN sudo apt-get update && sudo apt-get install locales -y &&
locale-gen en_US.UTF-8 &&
sudo localedef -i en_GB -f UTF-8 en_US.UTF

This should be part of your Dockerfile.

@dtodt
Copy link
Author

dtodt commented Feb 19, 2016

And so It is, I've copy-pasted what you input on the first comment.

On the log.txt @ line 76, has an error, that maybe is causing the locale problem.

@ghost
Copy link

ghost commented Feb 20, 2016

Try installing locales after you have installed meteor. your version of a Dockerfile isn't the exact copy of what I have shared. Let's see if it helps.

Next week, we'll publish a codenvy/meteor image with a short how-to.

@dtodt
Copy link
Author

dtodt commented Feb 21, 2016

Sry, was not the exact copy, I've changed the order of the commands, I didn't realize that the order could make some difference.

But today I've used your command, but seems that my image is different from yours.
Docker keep showing the 'debconf' error ..

[DOCKER] debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline

Here's the log.txt.

I did some research, and some people use an environment variable after 'from' declaration.

# Get noninteractive frontend for Debian to avoid some problems:
#    debconf: unable to initialize frontend: Dialog
ENV DEBIAN_FRONTEND noninteractive

But this does not worked for me.

I'll wait for the codenvy/meteor image, thanks.

@ghost
Copy link

ghost commented Feb 21, 2016

Indeed, that one failed. I experimented right in the terminal. This one works though:

FROM codenvy/node
RUN sudo npm install -g rimraf npm-check-updates cordova ionic
RUN curl https://install.meteor.com/ | sh
RUN sudo apt-get update && sudo apt-get install locales -y &&
sudo locale-gen en_US.UTF-8 &&
sudo localedef -i en_GB -f UTF-8 en_US.UTF
ENV LC_ALL=POSIX

@dtodt
Copy link
Author

dtodt commented Feb 23, 2016

Hey, thanks for the 'codenvy/meteor' stack. 👍

But, even with this stack I can't run a meteor project, at least inside 'projects' folder.
I managed to create a project outside of 'projects' folder, on a '~/prj1' test folder, and the project works.

Not sure why, but some permissions cannot be applied on 'projects' folder.

On projects folder:

user@1e1734f8a0b5:/projects/mantra-sample-blog-app$ meteor
[[[[[ /projects/mantra-sample-blog-app ]]]]]

=> Started proxy.
Unexpected mongo exit code 45. Restarting.
Unexpected mongo exit code 45. Restarting.
Unexpected mongo exit code 45. Restarting.
Can't start Mongo server.
MongoDB cannot open or obtain a lock on a file

On home folder:

user@1e1734f8a0b5:~/prj1/apple$ meteor -p 5005
[[[[[ ~/prj1/apple ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:5005/

I've tryed chmod and chown, but nothing can make my projects work inside 'projects' folder.
Maybe I can use symlink so that che can see my project or something like that ..

@ghost
Copy link

ghost commented Feb 23, 2016

Can you run ls -la in the root directory?

I tried it this way:

cd projects
meteor create newapp
cd newapp
meteor

No issues so far. What steps should I take to reproduce your issue?

@dtodt
Copy link
Author

dtodt commented Feb 23, 2016

Ok, here it is.

On /

drwxr-xr-x   5 root root   360 Feb 22 20:09 dev
drwxr-xr-x 101 root root  4096 Feb 22 20:09 etc
drwxr-xr-x   6 root root  4096 Feb 22 20:09 home
drwxr-xr-x  15 root root  4096 Feb 22 14:54 lib
drwxr-xr-x   2 root root  4096 Feb 22 14:54 lib64
drwxr-xr-x   2 root root    40 Feb 22 16:22 local-storage
drwxr-xr-x   2 root root  4096 Dec 18 05:58 media
drwxr-xr-x   3 root root  4096 Feb 22 20:09 mnt
drwxr-xr-x   3 root root  4096 Jan  6 20:20 opt
dr-xr-xr-x 160 root root     0 Feb 22 20:09 proc
drwxrwxrwx   1 user staff    0 Feb 22 20:38 projects
drwx------   2 root root  4096 Dec 18 05:59 root
drwxr-xr-x   8 root root  4096 Feb 22 20:09 run
drwxr-xr-x   2 root root  4096 Jan  4 18:47 sbin
drwxr-xr-x   2 root root  4096 Dec 18 05:58 srv
dr-xr-xr-x  13 root root     0 Feb 22 20:09 sys
drwxrwxrwt   5 root root  4096 Feb 22 21:09 tmp
drwxr-xr-x  22 root root  4096 Feb 22 20:08 usr
drwxr-xr-x  18 root root  4096 Feb 22 14:54 var

On /projects

drwxrwxrwx  1 user staff    0 Feb 22 20:38 .
drwxr-xr-x 55 root root  4096 Feb 22 20:09 ..
drwxrwxrwx  1 user staff 4096 Feb 22 20:47 mantra-sample-blog-app
drwxrwxrwx  1 user staff 4096 Feb 22 20:39 simple

On /projects/simple

drwxrwxrwx 1 user staff 4096 Feb 22 20:39 .
drwxrwxrwx 1 user staff    0 Feb 22 20:38 ..
drwxrwxrwx 1 user staff    0 Feb 22 20:39 .codenvy
drwxrwxrwx 1 user staff 4096 Feb 22 20:48 .meteor
-rwxrwxrwx 1 user staff   31 Feb 22 20:32 simple.css
-rwxrwxrwx 1 user staff  219 Feb 22 20:32 simple.html
-rwxrwxrwx 1 user staff  478 Feb 22 20:32 simple.js

On ~

drwxr-xr-x  11 user user  4096 Feb 23 10:45 .
drwxr-xr-x   6 root root  4096 Feb 22 20:09 ..
-rw-------   1 user user   587 Feb 23 10:35 .bash_history
-rw-r--r--   1 user user   220 Apr  9  2014 .bash_logout
-rw-r--r--   1 user user  3637 Apr  9  2014 .bashrc
drwxr-xr-x   3 user user  4096 Feb 22 20:32 .cordova
-rw-r--r--   1 user user    54 Feb 22 20:09 .gitconfig
-rw-r--r--   1 user user    39 Feb 22 20:09 .gitignore_codenvy
drwx------   2 user user  4096 Feb 22 14:56 .gnupg
drwxr-xr-x   6 user user  4096 Feb 22 21:06 .meteor
-rw-------   1 user user    90 Feb 22 20:33 .meteorsession    
drwxr-xr-x 467 user user 20480 Feb 22 20:47 .npm
drwxr-xr-x   2 user user  4096 Feb 22 20:09 .oracle_jre_usage 
-rw-r--r--   1 user user   675 Apr  9  2014 .profile
drwxr-xr-x   5 user user  4096 Feb 22 20:39 che
-rwxr-xr-x   1 root root    58 Jan  6 20:21 entrypoint.sh     
drwxr-xr-x   2 user user  4096 Feb 23 10:45 prj1

On ~/prj1

drwxr-xr-x  3 user user 4096 Feb 23 10:48 .
drwxr-xr-x 11 user user 4096 Feb 23 10:45 ..
drwxr-xr-x  3 user user 4096 Feb 23 10:48 simple

On ~/prj1/simple

drwxr-xr-x 3 user user 4096 Feb 23 10:48 .
drwxr-xr-x 3 user user 4096 Feb 23 10:48 ..
drwxr-xr-x 3 user user 4096 Feb 23 10:48 .meteor
-rw-r--r-- 1 user user   31 Feb 23 10:48 simple.css
-rw-r--r-- 1 user user  219 Feb 23 10:48 simple.html
-rw-r--r-- 1 user user  478 Feb 23 10:48 simple.js

At this time, seems to me that the 'staff' group could be the problem, but none of that commands worked:

sudo chown -R user:user projects/
sudo chgrp -R user projects/

@ghost
Copy link

ghost commented Feb 23, 2016

Yes, staff group might be the problem. You may want to add this chown command to your CMD instruction.

@dtodt
Copy link
Author

dtodt commented Feb 23, 2016

So, I put the chown and a bunch of other commands, but 'staff' group stays there ..

I think that's because 'projects' is a shared folder ..
Source: http://stackoverflow.com/a/28077088/1703546

Dockerfile:

FROM codenvy/meteor:ubuntu

RUN sudo mkdir /projects \
  && sudo chown -R user:user /projects \
  && sudo chgrp -R user /projects \
  && sudo chmod -R 777 /projects

RUN sudo npm install -g rimraf npm-check-updates

CMD tail -f /dev/null

@ghost
Copy link

ghost commented Feb 23, 2016

Put them to CMD. This should fix it. When a container starts, projects folder is mounted with the permissions of your local folder where projects live.

@dtodt
Copy link
Author

dtodt commented Feb 23, 2016

Uhmm .. after 'tail -f' ?

@ghost
Copy link

ghost commented Feb 23, 2016

No, actually before since if you place it after, it will never come to that point )

CMD sudo chown -R user:user /projects && sudo chgrp -R user /projects && sudo chmod -R 777 /projects && tailf /dev/null

@dtodt
Copy link
Author

dtodt commented Feb 23, 2016

Dumb question sry ..

So even doing this, the 'projects' folder stays with 'staff' definition, I've tried to put the user in staff group, but did not work neither.

Your folder is with another group ?
Maybe is something with sharing beteween windows and virtualbox.
I'm looking for something like that on google now ..

@ghost
Copy link

ghost commented Feb 23, 2016

That works on linux... You may want to add chown to the first command you execute when in the IDE

@dtodt
Copy link
Author

dtodt commented Feb 23, 2016

Sorry for the inconvenience, I could not make the project work properly.

But Meteor is now working again on Windows since 1.3-beta.11.
Then I'll continue my projects on windows, and I'll try Che again another time.

Thanks. 👍

@dtodt dtodt closed this as completed Feb 23, 2016
Katka92 pushed a commit to Katka92/che that referenced this issue Jun 27, 2018
* Fix for eclipse-che#6891

Make the `OpenshiftConnector` workspace route naming rule consistent
with custom server evaluation strategy in all cases (especially in case
of unexpected openshift.io user name).

This branch has a corresponding branch in upstream `eclipse/che`

Signed-off-by: David Festal <dfestal@redhat.com>

* formatting

Signed-off-by: David Festal <dfestal@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.
Projects
None yet
Development

No branches or pull requests

2 participants