diff --git a/README.md b/README.md index 15496901..4f257413 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ specific published models. ## Install Sax -### Install and set up the `gcloud` tool +### Installing and set up the `gcloud` tool [Install](https://cloud.google.com/sdk/gcloud#download_and_install_the) the `gcloud` CLI and set the default account and project: @@ -20,7 +20,7 @@ gcloud config set account gcloud config set project ``` -### Create a Cloud Storage bucket to store Sax server states +### Creating a Cloud Storage bucket to store Sax server states [Create](https://cloud.google.com/storage/docs/creating-buckets) a Cloud Storage bucket: @@ -30,7 +30,7 @@ GSBUCKET=sax-data gcloud storage buckets create gs://${GSBUCKET} ``` -### Create a Compute Engine VM instance for the admin server +### Creating a Compute Engine VM instance for the admin server [Create](https://cloud.google.com/compute/docs/create-linux-vm-instance) a Compute Engine VM instance: @@ -43,7 +43,7 @@ gcloud compute instances create sax-admin \ --scopes=https://www.googleapis.com/auth/cloud-platform ``` -### Create a Cloud TPU VM instance for a model server +### Creating a Cloud TPU VM instance for a model server Use this [guide](https://cloud.google.com/tpu/docs/users-guide-tpu-vm) to enable the Cloud TPU API in a Google Cloud project. @@ -85,7 +85,7 @@ bazel run saxml/bin:admin_config -- \ --alsologtostderr ``` -Start the Sax admin server: +Starting the Sax admin server: ``` bazel run saxml/bin:admin_server -- \ @@ -95,7 +95,7 @@ bazel run saxml/bin:admin_server -- \ --alsologtostderr ``` -### Start the Sax model server +### Starting the Sax model server SSH to the Cloud TPU VM instance: @@ -111,7 +111,7 @@ cd saxml saxml/tools/init_cloud_vm.sh ``` -Start the Sax model server: +Starting the Sax model server: ``` SAX_ROOT=gs://${GSBUCKET}/sax-root \ @@ -123,9 +123,9 @@ bazel run saxml/server:server -- \ --alsologtostderr ``` -You should see a log message "Joined [admin server IP:port]" from the model server to indicate it has successfully joined the admin server. +You should see a log message "Joined [admin server IP: port]" from the model server to indicate it has successfully joined the admin server. -## Use Sax +## Using Sax Sax comes with a command-line tool called `saxutil` for easy usage: diff --git a/RELEASE.md b/RELEASE.md index f6a17fa0..02d57a32 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,6 +1,6 @@ -# Release 0.1.0 +# Version 0.1.0 -# Major Features and Improvements +# Major Features and Improvements: * A Pax model server that supports Google Cloud TPU slice serving. * An admin server that manages model servers. diff --git a/saxml/server/acl.py b/saxml/server/acl.py index 173e0d99..08b49636 100644 --- a/saxml/server/acl.py +++ b/saxml/server/acl.py @@ -17,7 +17,7 @@ def Check(aclname: Optional[str], principal: Optional[str]) -> bool: - """Returns true iff username is allowed by the acl. + """Returns true if username is allowed by the acl. Args: aclname: The access control list. The ACL is currently just a dot-separated diff --git a/saxml/server/ipaddr.py b/saxml/server/ipaddr.py index 8c20fc8c..8c60fa1a 100644 --- a/saxml/server/ipaddr.py +++ b/saxml/server/ipaddr.py @@ -22,9 +22,9 @@ def MyIPAddr() -> str: hostname = socket.gethostname() try: - addrs = socket.getaddrinfo(hostname, None, socket.AF_INET6) - if addrs: - addr = addrs[0][4][0] + address = socket.getaddrinfo(hostname, None, socket.AF_INET6) + if address: + addr = address[0][4][0] ip = ipaddress.ip_address(addr) if not ip.is_link_local and (ip.is_private or ip.is_global): return addr @@ -32,9 +32,9 @@ def MyIPAddr() -> str: pass try: - addrs = socket.getaddrinfo(hostname, None, socket.AF_INET) - if addrs: - addr = addrs[0][4][0] + address = socket.getaddrinfo(hostname, None, socket.AF_INET) + if address: + addr = address[0][4][0] ip = ipaddress.ip_address(addr) if not ip.is_link_local and (ip.is_private or ip.is_global): return addr @@ -47,6 +47,6 @@ def MyIPAddr() -> str: def Join(ip: str, port: int) -> str: """Returns an IP address joined with a port.""" if not ip.startswith("[") and ":" in ip: - return "[%s]:%d" % (ip, port) + return f"[{ip}]: {port}" else: - return "%s:%d" % (ip, port) + return f"{ip}: {port}" % (ip, port)