Closed tfmeneses closed 3 years ago
cd /go/kuiper go build -trimpath --buildmode=plugin -o extensions/sinks/timescale/Timescale.so extensions/sinks/timescale/timescale.go
vi /tmp/ruletimescale.txt
{ "sql": "SELECT * from demo", "actions": [ { "timescale":{ "host": "172.17.0.3", "port":"5432", "username": "postgres", "password": "password", "database": "emdata", "table":"devicerecord", "fields": ["temperature","humidity"] } } ] }
@tfmeneses The golang plugin requires the same version for packages which are used in the main program and the plugin. Both eKuiper and your plugin(indirectly imported from github.com/jackc/pgx/v4 -> github.com/jackc/pgconn) use golang.org/x/crypto
but with different versions...
The plugin may not work in this scenario unless you are able to make your plugin depends on the same version as eKuiper. As a workaroud, you could add your plugin to eKuiper directly as part of it like mqtt sink. To do that, add your code to internal/topo/sink
and then add your sink to internal/topo/node/sink_node.go
doGetSink function.
By the way, we are working on "portable plugin" system to avoid these golang plugin restrictions. You may want to have a look and check if it fits your needs. Check out here
@tfmeneses The golang plugin requires the same version for packages which are used in the main program and the plugin. Both eKuiper and your plugin(indirectly imported from github.com/jackc/pgx/v4 -> github.com/jackc/pgconn) use
golang.org/x/crypto
but with different versions...The plugin may not work in this scenario unless you are able to make your plugin depends on the same version as eKuiper. As a workaroud, you could add your plugin to eKuiper directly as part of it like mqtt sink. To do that, add your code to
internal/topo/sink
and then add your sink tointernal/topo/node/sink_node.go
doGetSink function.
Excelent. Good know.
The problem was because are missing the 'm.conf = cfg' in configure method. Another think that I executed was:
go build -trimpath -o ./_build/kuiper-1.3.0-linux-amd64/bin/kuiperd cmd/kuiperd/main.go
Thank very much
Environment:
eKuiper version (e.g.
1.3.0
): lfedge/ekuiper:1.3.0Hardware configuration (e.g.
lscpu
): Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 39 bits physical, 48 bits virtual CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 165 Model name: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz Stepping: 2 CPU MHz: 2592.007 BogoMIPS: 5184.01 Virtualization: VT-x Hypervisor vendor: Microsoft Virtualization type: full L1d cache: 128 KiB L1i cache: 128 KiB L2 cache: 1 MiB L3 cache: 12 MiB Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcidsingle ssbd ibrs ibpb stibp ibrs enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves flush_l1d arch_capabilitiesOS (e.g.
cat /etc/os-release
): NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focalOthers:
What happened and what you expected to happen: Plugin Timescale worked
How to reproduce it (as minimally and precisely as possible): Create a plugin with the dependency "github.com/jackc/pgx/v4/pgxpool" Compile and install the plugin
Anything else we need to know?: