-
Notifications
You must be signed in to change notification settings - Fork 306
Add OSS support #199
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
Add OSS support #199
Conversation
|
@zou000 Can you move the python test file to |
terrytangyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great in general. Just left a couple small comments. Perhaps this could be some follow-up work but does OSS provide any mocking utilities similar to moto for S3 so we could write some simple unit tests?
|
If mocking is not possible, maybe some simple sanity test to make sure at least it build and runs, e.g., access some publicly accessible "hello world" file on OSS? |
I asked around, unfortunately, it seems there is neither an OSS mocking framework nor public accessible OSS files for tests. For example the popular OSS java sdk also rely on user's own credentials for tests: https://github.com/aliyun/aliyun-oss-java-sdk/blob/master/src/test/java/com/aliyun/oss/testing/ConcurrencyTest.java#L39 I made a change to skip OSS test cases if the env variables are absent. This is not ideal but at least it can test |
|
Thanks! I think it’s fine for now. Could you fix the Travis build? |
|
@zou000 the docker image of custom-op actually uses In tensorflow-io, we use I have created a patch that should fixed the build failures. Can you apply the patch: From dbf53e2d74e3eb90de99895c9aa83a6e9b05f9d2 Mon Sep 17 00:00:00 2001
From: Yong Tang <[email protected]>
Date: Thu, 2 May 2019 14:58:54 +0000
Subject: [PATCH] Add libexpat and fixed several dependency issues
Signed-off-by: Yong Tang <[email protected]>
---
WORKSPACE | 10 ++++++++++
third_party/libaprutil1.BUILD | 7 +++++--
third_party/libexpat.BUILD | 30 ++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 third_party/libexpat.BUILD
diff --git a/WORKSPACE b/WORKSPACE
index f105f64..0376dea 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -290,6 +290,16 @@ http_archive(
],
)
+http_archive(
+ name = "libexpat",
+ build_file = "//third_party:libexpat.BUILD",
+ sha256 = "574499cba22a599393e28d99ecfa1e7fc85be7d6651d543045244d5b561cb7ff",
+ strip_prefix = "libexpat-R_2_2_6/expat",
+ urls = [
+ "http://github.com/libexpat/libexpat/archive/R_2_2_6.tar.gz",
+ ],
+)
+
http_archive(
name = "libapr1",
build_file = "//third_party:libapr1.BUILD",
diff --git a/third_party/libaprutil1.BUILD b/third_party/libaprutil1.BUILD
index 6545137..ad9b6ac 100644
--- a/third_party/libaprutil1.BUILD
+++ b/third_party/libaprutil1.BUILD
@@ -4,7 +4,10 @@ licenses(["notice"]) # Apache license (for libapr1)
cc_library(
name = "libaprutil1",
- srcs = [
+ srcs = glob([
+ "include/private/apu_*.h",
+ "include/private/apr_*.h",
+ ]) + [
"buckets/apr_brigade.c",
"buckets/apr_buckets.c",
"buckets/apr_buckets_alloc.c",
@@ -112,10 +115,10 @@ cc_library(
"-lrt",
"-lcrypt",
"-lpthread",
- "-lexpat",
],
strip_include_prefix = "include",
deps = [
"@libapr1",
+ "@libexpat",
],
)
diff --git a/third_party/libexpat.BUILD b/third_party/libexpat.BUILD
new file mode 100644
index 0000000..f0e617c
--- /dev/null
+++ b/third_party/libexpat.BUILD
@@ -0,0 +1,30 @@
+# Description:
+# Expat library
+
+licenses(["notice"])
+
+exports_files(["COPYING"])
+
+cc_library(
+ name = "libexpat",
+ srcs = [
+ "lib/xmlparse.c",
+ "lib/xmlrole.c",
+ "lib/xmltok.c",
+ ],
+ hdrs = glob([
+ "lib/*.h",
+ ]) + [
+ "lib/xmltok_impl.c",
+ "lib/xmltok_ns.c",
+ ],
+ copts = [
+ "-DHAVE_MEMMOVE",
+ "-DXML_POOR_ENTROPY",
+ ],
+ includes = [
+ "lib",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [],
+)
--
2.17.2Also see attachment: |
|
@zou000 With the above the build should pass. |
|
@yongtang Perhaps let's get that patch PR'ed into master first. Otherwise the commit history here might be messed up and we might encounter issues with the CLA. |
|
@zou000 The PR #210 has been merged. You can rebase the master and make the following changes in libaprutil1.BUILD: diff --git a/third_party/libaprutil1.BUILD b/third_party/libaprutil1.BUILD
index 6545137..ad9b6ac 100644
--- a/third_party/libaprutil1.BUILD
+++ b/third_party/libaprutil1.BUILD
@@ -4,7 +4,10 @@ licenses(["notice"]) # Apache license (for libapr1)
cc_library(
name = "libaprutil1",
- srcs = [
+ srcs = glob([
+ "include/private/apu_*.h",
+ "include/private/apr_*.h",
+ ]) + [
"buckets/apr_brigade.c",
"buckets/apr_buckets.c",
"buckets/apr_buckets_alloc.c",
@@ -112,10 +115,10 @@ cc_library(
"-lrt",
"-lcrypt",
"-lpthread",
- "-lexpat",
],
strip_include_prefix = "include",
deps = [
"@libapr1",
+ "@libexpat",
],
) |
Like @yongtang mentioned above it would be great to have a development docker container consistent with CI and release environment. #203 introduced 2 changes that accidentally made OSS work. Besides the libexpat library, the image also contains a /etc/bazelrc file that circumvented a couple of bazel-in-docker bugs. @yongtang's suggested patch also circumvented this bug, but in a different way. Personally, I think the bazelrc way is better as it makes development the same in docker and on host. Though I will leave it to you guys to decide. I will update #200 with the info and close it. |
terrytangyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the efforts! @zou000 I'll merge this once the CI passes.
|
@zou000 @terrytangyuan Looks like there are still some issues on certain platforms. I think you could remove In other word, apply the following patch: diff --git a/third_party/libaprutil1.BUILD b/third_party/libaprutil1.BUILD
index 038a361..3b0d5d0 100644
--- a/third_party/libaprutil1.BUILD
+++ b/third_party/libaprutil1.BUILD
@@ -113,13 +113,12 @@ cc_library(
],
linkopts = [
"-lrt",
- "-lcrypt",
"-lpthread",
- "-lexpat",
],
strip_include_prefix = "include",
deps = [
"@libapr1",
"@libexpat",
+ "@boringssl//:ssl",
],
) |
|
Thanks and done. It would be great if we have a whitelist of allowed
dynamic libraries available on systems and a submit checker to enforce it.
-- Li
…On Thu, May 2, 2019 at 1:31 PM Yong Tang ***@***.***> wrote:
@zou000 <https://github.com/zou000> @terrytangyuan
<https://github.com/terrytangyuan> Looks like there are still some issues
on certain platforms. I think you could remove -lexpat and -lcrypt, and
add boringssl as the dependency
In other word, apply the following patch:
diff --git a/third_party/libaprutil1.BUILD b/third_party/libaprutil1.BUILD
index 038a361..3b0d5d0 100644--- a/third_party/libaprutil1.BUILD+++ b/third_party/libaprutil1.BUILD@@ -113,13 +113,12 @@ cc_library(
],
linkopts = [
"-lrt",- "-lcrypt",
"-lpthread",- "-lexpat",
],
strip_include_prefix = "include",
deps = [
***@***.***",
***@***.***",+ ***@***.***//:ssl",
],
)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#199 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADV3ANI6U7MXQGYX3MUMXLPTNFRZANCNFSM4HGWW26A>
.
|
|
@zou000 We are almost there. I managed to get MacOS building correctly with additional changes: The Travis CI passed with the above commit applied on top of your PR: https://travis-ci.org/yongtang/io/builds/527888963 Can you apply the changes in the commit and update the PR? |
|
Thanks Yong. I was working on the same direction but using conditional
macros. It seems working in CI.
-- Li
…On Fri, May 3, 2019 at 12:04 PM Yong Tang ***@***.***> wrote:
@zou000 <https://github.com/zou000> We are almost there. I managed to get
MacOS building correctly with additional changes:
2efaf48
<2efaf48>
The Travis CI passed with the above commit applied on top of your PR:
https://travis-ci.org/yongtang/io/builds/527888963
Can you apply the changes in the commit and update the PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#199 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADV3AI6X72T435EATGPXPTPTSEDXANCNFSM4HGWW26A>
.
|
|
Thanks for all the efforts! |
Fix #41