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

Multi-user Eclipse Che #6441

Merged
merged 298 commits into from
Oct 6, 2017
Merged

Multi-user Eclipse Che #6441

merged 298 commits into from
Oct 6, 2017

Conversation

skabashnyuk
Copy link
Contributor

@skabashnyuk skabashnyuk commented Sep 26, 2017

steps required before merge

What does this PR do?

Introduce multi-user Eclipse Che based on Keyclaok identity server.

What is it

How to run it.

docker run -it -e CHE_MULTIUSER=true -e CHE_HOST=<your ip> -e CHE_KEYCLOAK_AUTH__SERVER__URL=http://<your ip>:5050/auth -v /var/run/docker.sock:/var/run/docker.sock -v ~/.che-multiuser:/data eclipse/che:nightly start --skip:pull --skip:nightly

How to manage it

  • Keycloak configured with two realms. Master and che. Also we have one user admin/admin in both realm. Admin user in master realm is - super admin.
  • Eclipse Che configured for che realm
  • We enabled user registration in Che realm

Known limitation

How to run it when it is in a branch

To run an multiuser Che version, the following steps are required after building the branch:

  • Rebuild init, cli and che images (in the given sequence). To do that, proceed to folder dockerfiles/<image_name> and run build.sh
  • Run Che in a usual way using cli, with additional parameters: -e CHE_MULTIUSER=true and --skip:pull --skip:nightly
    Full command example:
    docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /home/user/.che:/data -e CHE_MULTIUSER=true eclipse/che-cli:nightly start --skip:pull --skip:nightly
  • MacOS users may need to edit che.env file in the data folder, changing CHE_HOST and CHE_KEYCLOAK_AUTH__SERVER__URL values to their specific IP.

When start is succeeded, the following docker containers should be created:

  • che, exposing 8080 port;
  • che_keycloak, exposing 5050 port;
  • che_postgres, exposing 5432 port;

What issues does this PR fix or reference?

#5362

Changelog

Introduce multi-user Eclipse Che based on Keyclaok identity server.

Release Notes

Introduce multi-user Eclipse Che based on Keyclaok identity server.

Docs PR

eclipse-che/che-docs#296

@codenvy-ci
Copy link

@benoitf
Copy link
Contributor

benoitf commented Oct 5, 2017

-0
adding keycloak support and having multi-user support is awesome. I love that.
But, there are too many duplicates in the code and it's kind hard to maintain as it's based on some include/exclude/duplicates between the two assemblies.
Besides that, it will be hard for onboarding users as they'll to figure out which assembly they need to use and it's not clear how you could migrate from one to another

@skabashnyuk
Copy link
Contributor Author

Good point @benoitf. We received a couple more feedback like yours. And we have an agreement to have a single assembly in next releases. It's going to improve onboarding and probably remove duplication problems you've mentioned.

@codenvy-ci
Copy link

@codenvy-ci
Copy link

Build # 4032 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/4032/ to view the results.

if (permissionsManager.getDomain(domain).isInstanceRequired() && instance == null) {
throw new BadRequestException("Specified domain requires non nullable value for instance");
}
}
Copy link
Contributor

@mshaposhnik mshaposhnik Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sleshchenko simplify proposal:

  checkArgument(domain != null, "Domain id required");
  checkArgument((permissionsManager.getDomain(domain).isInstanceRequired() && instance == null),
        "Specified domain requires non nullable value for instance"
    );

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be rewritten with checkArgument method. But then condition should be rewritten as

checkArgument(!permissionsManager.getDomain(domain).isInstanceRequired() || instance != null), "Specified domain requires non nullable value for instance");

So I'd not change it because then condition becomes more complicated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove negation in the checkArgument so than condition will be the same (and domain == null in first check )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is named after Precondition#checkArgument from guava. And I think it is
logical to have negation there while it is named in this way. Up to you change it or not =)

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@bmicklea
Copy link

bmicklea commented Oct 6, 2017

@skabashnyuk the move to a single assembly noted here is for multi-user only right? We haven’t agreed that we don’t need a single user assembly yet.

@skabashnyuk
Copy link
Contributor Author

@bmicklea it's topic TBD. I'll create an issue for that.

@eclipse-che eclipse-che deleted a comment from codenvy-ci Oct 6, 2017
@eclipse-che eclipse-che deleted a comment from codenvy-ci Oct 6, 2017
Running integrations tests on centos/postgresql-96-centos7 image
@codenvy-ci
Copy link

Build # 4042 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/4042/ to view the results.

@skabashnyuk skabashnyuk merged commit ee01b29 into master Oct 6, 2017
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 6, 2017
vinokurig pushed a commit that referenced this pull request Oct 9, 2017
Multi-user Eclipse Che (#6441)
#### How to run it.
```docker run -it -e CHE_MULTIUSER=true -e CHE_HOST=<your ip> -e CHE_KEYCLOAK_AUTH-SERVER-URL=http://<your ip>:5050/auth -v /var/run/docker.sock:/var/run/docker.sock -v ~/.che-multiuser:/data eclipse/che:nightly start --skip:pull --skip:nightly```
#### How to manage it
 - Keycloak configured with two realms. ```Master``` and ```che```. Also we have one user admin/admin in both realm. Admin user in master realm is  - super admin. 
-  Eclipse Che configured for che realm
- We enabled user registration in ```Che``` realm
#### Known limitation
 - swagger would not work. We need to upgrade a version. to support openid authentification #6015
- It's working on local docker. We are going to provide scalable version based on OpenShift on next versions.
- Invitation of non-existent users to Eclipse Che organization #6335
#### How to run it when it is in a branch


To run an multiuser Che version, the following steps are required after building the branch:
 - Rebuild init, cli and che images (in the given sequence). To do that, proceed to folder _dockerfiles/<image_name>_ and run _build.sh_
 - Run Che in a  usual way using cli, with additional parameters:  `-e CHE_MULTIUSER=true` and `--skip:pull --skip:nightly`  
   Full command example:
   `docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /home/user/.che:/data -e CHE_MULTIUSER=true eclipse/che-cli:nightly start --skip:pull --skip:nightly`
 - MacOS users may need to edit _che.env_ file in the data folder, changing `CHE_HOST` and `CHE_KEYCLOAK_AUTH__SERVER__URL` values to their specific IP.
 
When start is succeeded, the following docker containers should be created:  
 - che, exposing 8080 port;
 - che_keycloak, exposing 5050 port;  
 - che_postgres, exposing 5432 port;
@skabashnyuk skabashnyuk deleted the che-multiuser branch October 13, 2017 06:04
@JamesDrummond JamesDrummond mentioned this pull request Nov 7, 2017
@sainirijul
Copy link

Hi,
I am trying to set up a workspace supporting multiple concurrent users. For this, i am using Multiple user assembly of Eclipse che and followed this thread.

On running the below command in windows powershell:
docker run -it -e CHE_MULTIUSER=true -e CHE_HOST= -e CHE_KEYCLOAK_AUTH_SERVER_URL=http:///auth -v /var/run/docker.sock:/var/run/docker.sock -v /c/tmp:/data eclipse/che start

I am getting the below message:
WARN: Bound 'eclipse/che' to 'eclipse/che:5.22.1'
/scripts/base/startup_02_pre_docker.sh: line 14: /data/cli.log: Resource busy
INFO: (che cli): 5.22.1 - using docker 17.12.0-ce / docker4windows
WARN: Newer version '6.0.0-M4' available
INFO: (che start): Booted and reachable
INFO: (che start): Ver: 5.22.1
INFO: (che start): Use: http://localhost:8080
INFO: (che start): API: http://localhost:8080/swagger

Now can you please guide me further steps and other steps if i am missing to set up the workspace which multiple users can access concurrently from different machines ? I could not find simple straight forward documents/references for this. Your help would be highly appreciated.

Looking forward to your response.

skabashnyuk added a commit that referenced this pull request Jan 3, 2020
Multi-user Eclipse Che (#6441)
#### How to run it.
```docker run -it -e CHE_MULTIUSER=true -e CHE_HOST=<your ip> -e CHE_KEYCLOAK_AUTH-SERVER-URL=http://<your ip>:5050/auth -v /var/run/docker.sock:/var/run/docker.sock -v ~/.che-multiuser:/data eclipse/che:nightly start --skip:pull --skip:nightly```
#### How to manage it
 - Keycloak configured with two realms. ```Master``` and ```che```. Also we have one user admin/admin in both realm. Admin user in master realm is  - super admin. 
-  Eclipse Che configured for che realm
- We enabled user registration in ```Che``` realm
#### Known limitation
 - swagger would not work. We need to upgrade a version. to support openid authentification #6015
- It's working on local docker. We are going to provide scalable version based on OpenShift on next versions.
- Invitation of non-existent users to Eclipse Che organization #6335
#### How to run it when it is in a branch


To run an multiuser Che version, the following steps are required after building the branch:
 - Rebuild init, cli and che images (in the given sequence). To do that, proceed to folder _dockerfiles/<image_name>_ and run _build.sh_
 - Run Che in a  usual way using cli, with additional parameters:  `-e CHE_MULTIUSER=true` and `--skip:pull --skip:nightly`  
   Full command example:
   `docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /home/user/.che:/data -e CHE_MULTIUSER=true eclipse/che-cli:nightly start --skip:pull --skip:nightly`
 - MacOS users may need to edit _che.env_ file in the data folder, changing `CHE_HOST` and `CHE_KEYCLOAK_AUTH__SERVER__URL` values to their specific IP.
 
When start is succeeded, the following docker containers should be created:  
 - che, exposing 8080 port;
 - che_keycloak, exposing 5050 port;  
 - che_postgres, exposing 5432 port;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.