Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] "Hello World" issue for Che 7

> 2) Building a custom image is not really necessary. You can use an
> official gcc image as [1] or [2].

I wanted to choose the operating system, and in this case, I wanted to
use CentOS. I think the gcc images use Ubuntu? Not that there's anything
wrong with it, but I wanted to use a specific distro.

I provided 2 links. The second is centOS based.
 
> 3) You selected C as the language for your test. And we do not have a
> language server yet. You could have used go, python, java, c#,
> _javascript_ or php instead (the issue [3] with the initial Che 7 stacks).

True - but I don't know how to write "Hello, world!" in any of those
languages ;-)

Writing an hello world, in any of those languages, should be easy. Much easier than adding a new Che LS anyway ;-)
 

I have an idea in the back of my mind which I would like to try out -
but for a tutorial, I think I might follow your advice and do a hello.py

> About your questions:
>
>> How can I lint devfiles to check if I have a valid file before passing
>> it to Che?
> I don't think we have a way to verify that currently. We have the
> command chectl devfile:generate. I think it's a good idea to have chectl
> devfile:verify. I have created an issue [4]

Thank you. Will that require a running instance of Che, or can it run as
a disconnected command?

No chectl, in that case, won't need a running Che instance to verify a devfile.
 
>> In "how to start a workspace from a devfile, I did not know if there was
>> a way to upload a devfile as a Che instance admin to make it
>> available in the new project dashboard - can someone explain, if
>> that's possible, how to do it, please?
> The plan is to render the list of stacks that you see on the dashboard
> from the devfiles published in the devfile-registry. This task is not
> completed yet (see [5]) but when it will, you will be able to add a
> stack publishing a new devfile in the devfile-registry.

OK, thanks - and for a Che admin who wants to publish a custom devfile
(say, for a company-specific project) how would you do that?

The way we see it is that companies will have their own che devfile repository. An admin (or any contributor) can add a stack with a PR on the company devfile repo.
 
>> I would like to have the clangd language server running on
>> the workspace. How do I do that?
> I am afraid you need to wait for [6] to be completed or you can reach
> the language team on MM and help contributing to the doc

Ack, thanks.

>> I did not find a way to push changes to github - is there a way
>> to specify a private SSH key for my account to use with github, and to set
>> some git config settings (user.email and user.name <http://user.name> at
>> a minimum) for signing off and committing?
> That's something that annoys me as well and I am not sure we have a
> proper solution yet. At least until the GitHub pull-request plugin is
> going to land in the che-plugin-registry [7]. As of today you can
> generate a new SSH key, copy it in your workspace and adding it to your
> GH account.

I complicate things by using 2FA for authentication, so really the SSH
keys are the only way for me to commit. When you say "copy the key into
your workspace", do you mean creating a .ssh directory, copying the
private key in there, and uploading the public key?

>> What would be involved in running gdb to debug a C program, and
>> being able to manage it from the IDE?
> We need to have the C/C++ debug adapter running on the workspace. That's
> similar to your clangd question. Once this is done you can set a
> launch.json in your workspace (or devfile) to start your application in
> debug mode and control it from the IDE . 

Ack 2. If I do a hello.py, will I be able to use a Python debugger via DAP?

>> What's involved in running (say) SonarQube?
> Do you mean sonarlint? If that's the case you can add the
> plugin sonarsource/sonarlint-vscode/latest in your devfile. If you want
> instead to run SonarQube (or whatever service that can run on a docker
> image) you can use a component of type dockerimage.

I meant SonarQube - but really any developer tool that has a server
component would do. I would like to understand how to run a plug-in that
only runs in the IDE (like SonarLint), and one that uses some kind of
server side component (like SonarQube).


Thanks!
Dave.

> [1] https://hub.docker.com/_/gcc/
> [2] https://hub.docker.com/r/centos/devtoolset-7-toolchain-centos7/ 
> [3] https://github.com/eclipse/che/issues/12620
> [4] https://github.com/che-incubator/chectl/issues/121
> [5] https://github.com/eclipse/che/issues/13058
> [6] https://github.com/eclipse/che-docs/issues/718
> [7] https://github.com/eclipse/che/issues/11867
>
> On Thu, May 30, 2019 at 10:44 PM Dave Neary <dneary@xxxxxxxxxx
> <mailto:dneary@xxxxxxxxxx>> wrote:
>
>     Hi all,
>
>     I have written up what I have so far here:
>     https://github.com/dneary/hello-world/blob/master/Tutorial.md
>
>     I would love to get more information in here. Specifically:
>
>     * How can I lint devfiles to check if I have a valid file before passing
>     it to Che?
>     * In "how to start a workspace from a devfile, I did not know if there
>     was a way to upload a devfile as a Che instance admin to make it
>     available in the new project dashboard - can someone explain, if that's
>     possible, how to do it, please?
>     * Next steps:
>      - I would like to have the clangd language server running on the
>     workspace. How do I do that?
>      - I did not find a way to push changes to github - is there a way to
>     specify a private SSH key for my account to use with github, and to set
>     some git config settings (user.email and user.name
>     <http://user.name> at a minimum) for
>     signing off and committing?
>      - What would be involved in running gdb to debug a C program, and being
>     able to manage it from the IDE?
>      - What's involved in running (say) SonarQube?
>
>     I don't know how much I will be able to squeeze out of a
>     che.openshift.io <http://che.openshift.io> workspace, and I don't
>     know the answers to any of the
>     questions above, but I had some fun doing this today.
>
>     Thanks,
>     Dave.
>
>     On 30/05/2019 10:40, Dave Neary wrote:
>     > Progress! Thank you Artem.
>     >
>     > I now have a workspace, but no Make or GCC installed in the CentOS
>     > container. I was going to just install them in the container to check
>     > that this will work, but don't have root access.
>     >
>     > To the Dockerfiles we go!
>     >
>     > Thank you Artem, you got me over a hump.
>     >
>     > Dave.
>     >
>     > On 30/05/2019 10:17, Artem Zatsarynnyi wrote:
>     >> Hi Dave,
>     >> I've opened the PR into your repo with a couple of fixes for your
>     Devfile
>     >> https://github.com/dneary/hello-world/pull/1
>     >>
>     >> On Thu, May 30, 2019 at 3:58 PM Dave Neary <dneary@xxxxxxxxxx
>     <mailto:dneary@xxxxxxxxxx>
>     >> <mailto:dneary@xxxxxxxxxx <mailto:dneary@xxxxxxxxxx>>> wrote:
>     >>
>     >>     Hi all,
>     >>
>     >>     I thought I would create a devfile for the simplest project I
>     could
>     >>     think of for Che 7, and document what was involved.
>     >>
>     >>     You can follow along here:
>     >>     https://github.com/dneary/hello-world/
>     >>
>     >>     This is a single C file and Makefile to compile it to a binary.
>     >>     Prerequisites are GCC and make, and I want to have a build
>     target that
>     >>     runs make, and a run target that runs hello in the terminal.
>     >>
>     >>     The issues I'm having are how to make a bare bones devfile. I
>     get the
>     >>     following errors (formated for ease of reading - 2 questions
>     to follow):
>     >>
>     >>     > Error occurred during creation a workspace from devfile
>     located at
>     >>   
>      `https://raw.githubusercontent.com/dneary/hello-world/master/devfile.yaml`
>     <https://raw.githubusercontent.com/dneary/hello-world/master/devfile.yaml>
>     >>   
>      <https://raw.githubusercontent.com/dneary/hello-world/master/devfile.yaml>.
>     >>     >
>     >>     > Cause: Devfile schema validation failed.
>     >>     > Errors: [
>     >>     >
>     >>     > /devfile/components/0 object instance has properties which
>     are not
>     >>     allowed by the schema: ["mountsources"],
>     >>     > instance failed to match exactly one schema (matched 0 out
>     of 3),
>     >>     > /devfile/components/0 object instance has properties which
>     are not
>     >>     allowed by the schema:
>     ["args","command","env","image","mountsources"],
>     >>     > /devfile/components/0 object has missing required
>     properties (["id"]),
>     >>     > /devfile/components/0 object instance has properties which
>     are not
>     >>     allowed by the schema:
>     >>     ["args","command","env","image","memoryLimit","mountsources"],
>     >>     > instance failed to match at least one required schema among 2,
>     >>     > /devfile/components/0 object has missing required properties
>     >>     (["reference"]),
>     >>     > /devfile/components/0 object has missing required properties
>     >>     (["referenceContent"]),
>     >>     > /devfile/components/0 object instance has properties which
>     are not
>     >>     allowed by the schema: ["mountsources"]
>     >>     > ]
>     >>
>     >>
>     >>     My questions:
>     >>
>     >>     * Is there a devfile schema validator I can run locally which
>     will save
>     >>     me doing testing by trying to run this through
>     che.openshift.io <http://che.openshift.io>
>     >>     <http://che.openshift.io> (my
>     >>     current testing method)?
>     >>     * What is the strict minimal devfile that I would need to
>     have to be
>     >>     able to compile and run my project?
>     >>
>     >>     Thanks,
>     >>     Dave.
>     >>
>     >>
>     >>     --
>     >>     Dave Neary - Eclipse Che Ecosystem & Community Manager
>     >>     Open Source and Standards - Red Hat
>     >>     E: dneary@xxxxxxxxxx <mailto:dneary@xxxxxxxxxx>
>     <mailto:dneary@xxxxxxxxxx <mailto:dneary@xxxxxxxxxx>> / T: @nearyd / Ph:
>     >>     +1-978-799-3338
>     >>     _______________________________________________
>     >>     che-dev mailing list
>     >>     che-dev@xxxxxxxxxxx <mailto:che-dev@xxxxxxxxxxx>
>     <mailto:che-dev@xxxxxxxxxxx <mailto:che-dev@xxxxxxxxxxx>>
>     >>     To change your delivery options, retrieve your password, or
>     >>     unsubscribe from this list, visit
>     >>     https://www.eclipse.org/mailman/listinfo/che-dev
>     >>
>     >>
>     >>
>     >> --
>     >> Artem Zatsarynnyi
>     >> Software Engineer
>     >> DevTools, Eclipse Che
>     >>
>     >> _______________________________________________
>     >> che-dev mailing list
>     >> che-dev@xxxxxxxxxxx <mailto:che-dev@xxxxxxxxxxx>
>     >> To change your delivery options, retrieve your password, or
>     unsubscribe from this list, visit
>     >> https://www.eclipse.org/mailman/listinfo/che-dev
>     >>
>     >
>
>     --
>     Dave Neary - Eclipse Che Ecosystem & Community Manager
>     Open Source and Standards - Red Hat
>     E: dneary@xxxxxxxxxx <mailto:dneary@xxxxxxxxxx> / T: @nearyd / Ph:
>     +1-978-799-3338
>     _______________________________________________
>     che-dev mailing list
>     che-dev@xxxxxxxxxxx <mailto:che-dev@xxxxxxxxxxx>
>     To change your delivery options, retrieve your password, or
>     unsubscribe from this list, visit
>     https://www.eclipse.org/mailman/listinfo/che-dev
>
>
> _______________________________________________
> che-dev mailing list
> che-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/che-dev
>

--
Dave Neary - Eclipse Che Ecosystem & Community Manager
Open Source and Standards - Red Hat
E: dneary@xxxxxxxxxx / T: @nearyd / Ph: +1-978-799-3338

Back to the top