-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
304 additions
and
20 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 |
---|---|---|
@@ -1,5 +1,48 @@ | ||
workspace(name = "ai_playground") | ||
|
||
load("//bazel:workspace.bzl", "repositories") | ||
|
||
repositories() | ||
|
||
# Load the LLVM toolchain | ||
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies") | ||
bazel_toolchain_dependencies() | ||
|
||
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain") | ||
llvm_toolchain( | ||
name = "llvm_toolchain", | ||
llvm_version = "16.0.0", | ||
) | ||
|
||
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") | ||
llvm_register_toolchains() | ||
|
||
### Python Setup | ||
load("@rules_python//python:pip.bzl", "pip_install") | ||
|
||
pip_install( | ||
name = "pip", | ||
requirements = "//bazel/python:requirements.txt", | ||
) | ||
|
||
### Gazelle Setup | ||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") | ||
### Golang Setup | ||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
go_rules_dependencies() | ||
go_register_toolchains(version = "1.18") | ||
gazelle_dependencies() | ||
|
||
load("//bazel/go:deps.bzl", "go_dependencies") | ||
go_dependencies() | ||
|
||
### Rust Setup | ||
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") | ||
rules_rust_dependencies() | ||
rust_register_toolchains() | ||
|
||
### Docker Setup | ||
load("@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories") | ||
container_repositories() | ||
|
||
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") | ||
container_deps() |
Empty file.
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,67 @@ | ||
load("@bazel_gazelle//:deps.bzl", "go_repository") | ||
|
||
def go_dependencies(): | ||
go_repository( | ||
name = "com_github_cpuguy83_go_md2man_v2", | ||
importpath = "github.com/cpuguy83/go-md2man/v2", | ||
sum = "h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=", | ||
version = "v2.0.2", | ||
) | ||
go_repository( | ||
name = "com_github_go_logr_logr", | ||
importpath = "github.com/go-logr/logr", | ||
sum = "h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE=", | ||
version = "v1.2.0", | ||
) | ||
|
||
go_repository( | ||
name = "com_github_inconshreveable_mousetrap", | ||
importpath = "github.com/inconshreveable/mousetrap", | ||
sum = "h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=", | ||
version = "v1.0.0", | ||
) | ||
|
||
go_repository( | ||
name = "com_github_russross_blackfriday_v2", | ||
importpath = "github.com/russross/blackfriday/v2", | ||
sum = "h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=", | ||
version = "v2.1.0", | ||
) | ||
go_repository( | ||
name = "com_github_spf13_cobra", | ||
importpath = "github.com/spf13/cobra", | ||
sum = "h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=", | ||
version = "v1.5.0", | ||
) | ||
go_repository( | ||
name = "com_github_spf13_pflag", | ||
importpath = "github.com/spf13/pflag", | ||
sum = "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=", | ||
version = "v1.0.5", | ||
) | ||
|
||
go_repository( | ||
name = "in_gopkg_check_v1", | ||
importpath = "gopkg.in/check.v1", | ||
sum = "h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=", | ||
version = "v0.0.0-20161208181325-20d25e280405", | ||
) | ||
|
||
go_repository( | ||
name = "in_gopkg_yaml_v2", | ||
importpath = "gopkg.in/yaml.v2", | ||
sum = "h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=", | ||
version = "v2.4.0", | ||
) | ||
go_repository( | ||
name = "io_k8s_klog_v2", | ||
importpath = "k8s.io/klog/v2", | ||
sum = "h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=", | ||
version = "v2.80.1", | ||
) | ||
go_repository( | ||
name = "com_github_gorilla_mux", | ||
importpath = "github.com/gorilla/mux", | ||
sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", | ||
version = "v1.8.0", | ||
) |
Empty file.
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,3 @@ | ||
Werkzeug==2.2.2 | ||
Flask==2.0.2 | ||
kubernetes==27.2.0 |
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,17 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
go_library( | ||
name = "go_web_lib", | ||
srcs = ["main.go"], | ||
importpath = "github.com/lshmouse/ai-playground/experimental/go_example/go_web", | ||
visibility = ["//visibility:private"], | ||
deps = [ | ||
"@com_github_gorilla_mux//:mux", | ||
], | ||
) | ||
|
||
go_binary( | ||
name = "go_web", | ||
embed = [":go_web_lib"], | ||
visibility = ["//visibility:public"], | ||
) |
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,33 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
"os" | ||
|
||
"github.com/gorilla/mux" | ||
) | ||
|
||
func YourHandler(w http.ResponseWriter, r *http.Request) { | ||
log.Println("Received request") | ||
w.Write([]byte("Bazoku is cool!!")) | ||
} | ||
|
||
func getPort() string { | ||
port := os.Getenv("PORT") | ||
if port == "" { | ||
return "8080" | ||
} | ||
|
||
return port | ||
} | ||
|
||
func main() { | ||
r := mux.NewRouter() | ||
// Routes consist of a path and a handler function. | ||
r.HandleFunc("/", YourHandler) | ||
// Bind to a port and pass our router in | ||
port := getPort() | ||
log.Println("Going to listen on port: " + port) | ||
log.Fatal(http.ListenAndServe(":"+port, r)) | ||
} |
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,22 @@ | ||
load("@rules_python//python:defs.bzl", "py_binary", "py_library") | ||
load("@pip//:requirements.bzl", "requirement") | ||
|
||
py_binary( | ||
name = "python_cli", | ||
srcs = ["python_cli.py"], | ||
) | ||
|
||
py_library( | ||
name = "python_web_lib", | ||
srcs = ["python_web.py"], | ||
deps = [ | ||
requirement("Flask"), | ||
], | ||
) | ||
|
||
py_binary( | ||
name = "python_web", | ||
srcs = ["python_web.py"], | ||
main = "python_web.py", | ||
deps = [":python_web_lib"], | ||
) |
File renamed without changes.
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,10 @@ | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def hello(): | ||
return "hello world" | ||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0') |
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 @@ | ||
package(default_visibility = ["//visibility:public"]) |
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,2 @@ | ||
## bazel_gazelle | ||
See: https://github.com/bazelbuild/bazel-gazelle |
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,13 @@ | ||
"""Loads the bazel_gazelle library""" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def repo(): | ||
http_archive( | ||
name = "bazel_gazelle", | ||
sha256 = "efbbba6ac1a4fd342d5122cbdfdb82aeb2cf2862e35022c752eaddffada7c3f3", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.27.0/bazel-gazelle-v0.27.0.tar.gz", | ||
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.27.0/bazel-gazelle-v0.27.0.tar.gz", | ||
], | ||
) |
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 @@ | ||
package(default_visibility = ["//visibility:public"]) |
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,10 @@ | ||
"""Loads the rules_docker library""" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def repo(): | ||
http_archive( | ||
name = "io_bazel_rules_docker", | ||
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf", | ||
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"], | ||
) |
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 @@ | ||
package(default_visibility = ["//visibility:public"]) |
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,2 @@ | ||
## rules_go | ||
See: https://github.com/bazelbuild/rules_go |
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,11 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def repo(): | ||
http_archive( | ||
name = "io_bazel_rules_go", | ||
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", | ||
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", | ||
], | ||
) |
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,8 +1 @@ | ||
load("@rules_python//python:defs.bzl", "py_binary") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
py_binary( | ||
name = "example", | ||
srcs = ["example.py"], | ||
) | ||
package(default_visibility = ["//visibility:public"]) |
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,6 @@ | ||
## rules_python | ||
|
||
See: https://rules-python.readthedocs.io/ | ||
|
||
### references | ||
- https://github.com/bazelbuild/rules_python |
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 @@ | ||
package(default_visibility = ["//visibility:public"]) |
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,2 @@ | ||
## rules_rust | ||
See: https://bazelbuild.github.io/rules_rust/ |
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,12 @@ | ||
"""Loads the rules_proto library""" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def repo(): | ||
# To find additional information on this release or newer ones visit: | ||
# https://github.com/bazelbuild/rules_rust/releases | ||
http_archive( | ||
name = "rules_rust", | ||
integrity = "sha256-Weev1uz2QztBlDA88JX6A1N72SucD1V8lBsaliM0TTg=", | ||
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.48.0/rules_rust-v0.48.0.tar.gz"], | ||
) |
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 @@ | ||
package(default_visibility = ["//visibility:public"]) |
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,2 @@ | ||
## toolchains_llvm | ||
See: https://github.com/bazel-contrib/toolchains_llvm |
Oops, something went wrong.