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

Question: Scala Native build #192

Open
novakov-alexey opened this issue Feb 19, 2023 · 6 comments · May be fixed by #239
Open

Question: Scala Native build #192

novakov-alexey opened this issue Feb 19, 2023 · 6 comments · May be fixed by #239

Comments

@novakov-alexey
Copy link
Contributor

@joan38 , @armanbilge Is it possible to use kubernetes-client with Scala Native? If not - what does prevent us from making this happen? Some particular Java package is not yet available in Scala Native target?

@armanbilge
Copy link

Thanks for the ping. This will be blocked by the same reason as:

If we can make it work on Scala.js, then Scala Native can follow closely. Off the top of my head the primary issues are:

  1. circe-yaml uses Snake Yaml, which is a Java dep.
  2. We need a WebSocket client, which http4s Ember does not yet support.
  3. We need to deal with some crypto/security code in SslContexts.

I am still motivated on this, and have been slowly working on it.

  1. circe-scala-yaml can be a replacement for circe-yaml.

  2. I have proposed making an Ember Web Socket client as a Google Summer of Code project for the Scala Center. So hopefully a student will be paid to work on that this summer :)

    We also recently got a Web Socket client in http4s-curl. Unfortunately, Web Socket support in cURL itself is currently experimental, so I don't think that's a great option yet.

    Alternatively, maybe this project can be refactored so that the web socket is optional.

  3. I haven't looked too closely at SslContexts, probably we will just need platform-specific implementations of that.

SInce I last checked the codebase there could be new issues that I missed.

@novakov-alexey
Copy link
Contributor Author

Great stuff. Thank you for the detailed update and your titanic efforts to get all the things around Scala Native and JS going forward!

As for optional web-sockets support. Kubernetes-client is using web-sockets in PodsApi for running a pod exec command and upload/download files. This functionality can be quite important for Kubernetes Operators, which could be potentially written with help of THIS project and Scala Native.

Looking forwards to updates on this subject.

Also, I will be able to contribute smaller parts related to above list, if you have something to share as small task.

@armanbilge
Copy link

This functionality can be quite important for Kubernetes Operators, which could be potentially written with help of THIS project and Scala Native.

Awesome! Yes, this is what I thought—so that Ember Web Socket client will be quite important.

Also, I will be able to contribute smaller parts related to above list, if you have something to share as small task.

Thanks! If you have time, the circe-scala-yaml project I linked needs some basic maintenance work to revive the test suites and stuff. Right now it is mostly a hasty fork of circe-yaml with the parser swapped out :)

@armanbilge
Copy link

Something else you can look into, is cross-platform the SSLContext. The good news is we already have cross-platform TLS in FS2, so we probably want to change this API to return an fs2.io.net.tls.TLSContext[F] instead of a Java SSLContext.

def fromConfig[F[_]](config: KubeConfig[F]): SSLContext = {

After that, it looks like it is a matter of getting data out of the KubeConfig and loading it into the TLSContext. This will require platform-specific code, since each platform configures SSL/TLS differently.

@armanbilge
Copy link

Google Summer of Code http4s Ember Websocket Client project is now announced! Please spread the word :)

https://github.com/scalacenter/GoogleSummerOfCode#http4s-ember-websocket-client

@novakov-alexey
Copy link
Contributor Author

@armanbilge I will have a look at the circe-scala-yaml tests

@joan38 joan38 linked a pull request Oct 9, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants