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

jarek/5039: autotranslation [WIP] #7542

Merged
merged 21 commits into from
Jun 25, 2018
Merged

Conversation

jaroslawmalekcodete
Copy link
Contributor

No description provided.

def init_env():
os.environ["BEAKERX_BASIC_AUTH_USERNAME"] = "beakerx"
os.environ["BEAKERX_BASIC_AUTH_PASSWORD"] = random_string_generator()
os.environ["BEAKERX_FLASK_SERVER_PORT"] = str(get_free_tcp_port())
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for BEAKERX_BASIC_AUTH_USERNAME just make it constant on the other side
BEAKERX_BASIC_AUTH_PASSWORD → BEAKERX_AUTOTRANSLATION_PASSWORD
BEAKERX_FLASK_SERVER_PORT → BEAKERX_AUTOTRANSLATION_PORT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

return System.getenv("BEAKERX_BASIC_AUTH_PASSWORD");
}

private static String flaskServerPort() {
Copy link
Contributor

Choose a reason for hiding this comment

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

rename flaskServerPort to autotranslationPort

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,40 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to BeakerXClient.java

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,31 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

rename BeakerxClientManager.java to BeakerXClientManager.java

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -100,6 +108,11 @@ public ClassLoader getClassLoaderForImport() {
return getClassLoader();
}

@Override
public BeakerxClient getBeakerx() {
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to getBeakerX

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@scottdraves
Copy link
Contributor

this is awesome!! it works!

# Conflicts:
#	kernel/base/src/main/java/com/twosigma/beakerx/evaluator/EvaluatorManager.java
#	kernel/base/src/main/java/com/twosigma/beakerx/kernel/Kernel.java
#	kernel/base/src/test/java/com/twosigma/beakerx/KernelTest.java
#	kernel/groovy/src/test/java/com/twosigma/beakerx/groovy/evaluator/GroovyEvaluatorTest.java
#	kernel/sql/src/main/java/com/twosigma/beakerx/sql/BeakerParser.java
#	kernel/sql/src/main/java/com/twosigma/beakerx/sql/evaluator/SQLEvaluator.java
#	kernel/sql/src/main/java/com/twosigma/beakerx/sql/kernel/SQL.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLAutocompleteTest.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLBaseEvaluatorTest.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLEvaluatorTest.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLKernelTest.java
# Conflicts:
#	kernel/base/src/main/java/com/twosigma/beakerx/evaluator/EvaluatorManager.java
#	kernel/base/src/main/java/com/twosigma/beakerx/kernel/Kernel.java
#	kernel/base/src/test/java/com/twosigma/beakerx/KernelTest.java
#	kernel/groovy/src/test/java/com/twosigma/beakerx/groovy/evaluator/GroovyEvaluatorTest.java
#	kernel/sql/src/main/java/com/twosigma/beakerx/sql/BeakerParser.java
#	kernel/sql/src/main/java/com/twosigma/beakerx/sql/evaluator/SQLEvaluator.java
#	kernel/sql/src/main/java/com/twosigma/beakerx/sql/kernel/SQL.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLAutocompleteTest.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLBaseEvaluatorTest.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLEvaluatorTest.java
#	kernel/sql/src/test/java/com/twosigma/beakerx/sql/SQLKernelTest.java
@scottdraves
Copy link
Contributor

when in the groovy kernel we run
beakerx.x = 1
and the value gets set in JS, the Proxy object is then sending the value to the server.
But the value came from the server, this is not needed.
Need some kind of back door.
https://github.com/twosigma/beakerx/blob/jarek/5039_autotranslation_v2/js/notebook/src/extension.js#L188


set: function (obj, prop, value) {
obj[prop] = value;
var comm = Jupyter.notebook.kernel.comm_manager.new_comm('beaker.autotranslation', null, null, null, utils.uuid());
Copy link
Contributor

Choose a reason for hiding this comment

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

create this once and reuse it with each msg.
also, name the channel "beakerx.autotranslation".

Copy link
Contributor

Choose a reason for hiding this comment

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

are all our channels named "beakerx.*"?

Copy link
Contributor

Choose a reason for hiding this comment

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

nope, but I will change the names from beaker.* to beakerx.*

@scottdraves scottdraves merged commit 1ecc938 into master Jun 25, 2018
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 this pull request may close these issues.

None yet

3 participants