-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Provisioner] Open ports on AWS & GCP (#2210)
* finished AWS & GCP, test passed on GCP * GCP now create rules with cluster-specified tags * Creating new SGs on AWS and configuring user specified rules * new SG name * move to resources & allow tcp only * disable request of newer ports in task.yaml * lint * delete firewall rules & aws SGs after teardown * add smoke test & cluster name length limit * format * add doc * add error when not using aws & gcp * add failover * remove redundant length checking * temporary remove failover and wait for #2245 * move to new provisioner api * add unsupported feature * add ports to resources.get_required_cloud_features * use CloudImplementationFeatures to validate port * remove assert for interrupted launching process * renaming provision package * AWS: only create new SG when port is specified * nit: variable name * remove redundant error message since check is done in resources validation * support port range * refactor GCP implementation * remove unused function * rename gcp rule name to avoid dependency and name too long * remove redundant tags * remove redundant silent argument * change cluster name hash to truncate + hash * format * remove create firewall wait function * rename hash_cluster_name to truncate_and_hash_cluster_name * fix error when launching TPU node * disable TPU with ports for now * format * enable tpu nodes * enable tpu vm * raise error instead of assert * Update sky/skylet/providers/gcp/config.py Co-authored-by: Zhanghao Wu <[email protected]> --------- Co-authored-by: Zhanghao Wu <[email protected]>
- Loading branch information
1 parent
1add829
commit fa4dd65
Showing
26 changed files
with
427 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 33828 | ||
|
||
|
||
class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler): | ||
|
||
def do_GET(self): | ||
self.send_response(200) | ||
self.send_header('Content-type', 'text/html') | ||
self.end_headers() | ||
html = ''' | ||
<html> | ||
<head> | ||
<title>Test Page</title> | ||
</head> | ||
<body> | ||
<h1>This is a demo HTML page.</h1> | ||
</body> | ||
</html> | ||
''' | ||
self.wfile.write(bytes(html, 'utf8')) | ||
return | ||
|
||
|
||
Handler = MyHttpRequestHandler | ||
|
||
with socketserver.TCPServer(("", PORT), Handler) as httpd: | ||
print("serving at port", PORT) | ||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resources: | ||
ports: | ||
- 33828 | ||
|
||
workdir: ./examples/http_server_with_custom_ports | ||
|
||
run: python3 server.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""AWS provisioner for SkyPilot.""" | ||
|
||
from sky.provision.aws.instance import (query_instances, terminate_instances, | ||
stop_instances) | ||
from sky.provision.aws.instance import (cleanup_ports, query_instances, | ||
terminate_instances, stop_instances) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""GCP provisioner for SkyPilot.""" | ||
|
||
from sky.provision.gcp.instance import stop_instances, terminate_instances | ||
from sky.provision.gcp.instance import stop_instances, terminate_instances, cleanup_ports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.