Filters defined in query are missing from request body

For queries like
UsersIndex.query(bool: { filter: [{ term: {"country": "US"}}]}).filter(term: { "confirmed": true })

I'm expecting the request body would be
{:query=>{:bool=>{:filter=>[{:term=>{:country=>"US"}}, {:term=>{:confirmed=>true}}]}}}

However, the real request body is
{:query=>{:bool=>{:filter=>{:term=>{:confirmed=>true}}}}}

I tracked down the issue to this line of code https://github.com/toptal/chewy/blob/master/lib/chewy/search/parameters.rb#L157
Is it a bug?

@pyromaniac Are filters not chainable?

@oricodes89 Sure. But according the documentation, I should be able to chain filters and queries all together.
And the problem is resolvable by changing from query[:query][:bool].merge!(filter) to something like query[:query][:bool][:filter].concat(filter[:filter]).
So I wonder whether it is a bug or there might be some other unexpected results of doing the above fix.

@jiajiawang But you can chain filters and queries, just use the DSL provided by chewy.
UsersIndex.query(term: {"country": "US"}).filter(term: { "confirmed": true })

=> {:query=>{:bool=>{:must=>{:term=>{:country=>"US"}}, :filter=>{:term=>{:confirmed=>true}}}}}

It doesn't return what you expected on your original post:

{:query=>{:bool=>{:filter=>[{:term=>{:country=>"US"}}, {:term=>{:confirmed=>true}}]}}}

But you can use two filter queries like I suggested if you want to render that particular query.

@oricodes89 I have no doubt that chaining two filters can result in the request body I want. But that's not my question.
I'm just expecting
UsersIndex.query(bool: { filter: [{ term: {"country": "US"}}]}).filter(term: { "confirmed": true })

would result in the same request body.
But it's not and I believe it's a bug.

@jiajiawang I guess I'm missing something on the documentation, can you share an example on it?

@oricodes89 I'm not sure what other examples you want me to share.
This is the simplest example I can think of to explain the issue.
UsersIndex.query(bool: { filter: { term: {"country": "US"}}}) returns
:body=>{:query=>{:bool=>{:filter=>{:term=>{:country=>"US"}}}}}.
UsersIndex.filter(term: { "confirmed": true }) returns
:body=>{:query=>{:bool=>{:filter=>{:term=>{:confirmed=>true}}}}}.
UsersIndex.query(bool: { filter: { term: {"country": "US"}}}).filter(term: { "confirmed": true }) returns
:body=>{:query=>{:bool=>{:filter=>{:term=>{:confirmed=>true}}}}}.
Is this your expected result of chaining them?

Mmm...I guess I never expected it because the gem does not give you any example combining those kinds of queries.


Can be able to define the port by myself.

I want to define the port number by myself.
e.g: like this
Please review.

Is the purpose of this to define your exporter's default port number?

Thank you for your reviewing.
I fixed. Please review again.

LGTM, thanks 👍

Thank you! 😄


How to reload the database？

use by electron.
i have tow Renderer Process。
I call the page A and page B
Page A list data
Page B add data
When the page B  add data, I notice the page A to reload the data
But the problem is that the page A query data is old data
I want to reload the database and get the latest results.What should be done？
My English is not good, please forgive me

The problem is solved！！
Should be Initialization db object in main Process。
mian Process  like this:
initDataDB(); global.dataDB = dataDB;
Renderer Process use  like this
dataDB = remote.getGlobal('dataDB');


unique_combination_of_columns should be configurable for not failing with null values

Describe the feature
Currently unique_combination_of_columns test will always fail if null values in the columns that are tested result in non-unique combinations.
For example, consider the orders table below:

order_id
client_name
country

1
Company X
US

2
Company X
UK

3
Company Y
null

4
Company Y
null

And the corresponding schema.yml:
models:
  - name: orders
    columns:
      - name: order_id
      - name: client_name
      - name: country
    tests:
      - dbt_utils.unique_combination_of_columns:
           combination_of_columns:
             - client_name
             - country

In the example above the unique_combination_of_columns test will always fail because of the last two rows. ❌
However, same way that the uniqueness test should not be violated by null values in a unique key column, I think the same logic applies to a combination of multiple unique key columns - if a not_null test is needed, it should be added separately to relevant columns in schema.yml.
Describe alternatives you've considered

Creating a surrogate key - doesn't work, because there are cases when a column has null values, but unique combination only needs to be validated for existing values
Adding not_null tests to specific columns - doesn't fit the use case

What worked
I've adapted the original source code of unique_combination_of_columns test to write a custom test:
{% test column_combination_is_unique_where_not_null(model, column_names) %}

with validation_errors as (
    select
        {{ column_names | join(', ') }}
    from {{ model }}
    WHERE
    {%- for column in column_names %}
      {{ "AND" if not loop.first }} {{ column }} IS NOT NULL
    {% endfor -%}
    group by {{ column_names | join(', ') }}
    having count(*) > 1
)

select *
from validation_errors

{% endtest %}

If there are reasons against having this as a default behaviour, I think having an optional argument like count_nulls=true to conditionally add/remove the WHERE clause would be great!
Who will this benefit?
Anyone dealing with unique combination of columns, where null values are allowed.
Are you interested in contributing this feature?
Yes! ✅

Hmmm this is a very interesting point @The-Pavel! The link to the original Core issue way back when is a good callout.
It certainly can't be the default behaviour, because that would result is a breaking change compared to what is shipping in version 1.x.y of the package, and we won't make any non-backwards-compatible breaking changes.
Could you do it like this:
models:
  - name: orders
    columns:
      - name: order_id
      - name: client_name
      - name: country
    tests:
      - dbt_utils.unique_combination_of_columns:
           combination_of_columns:
             - client_name
             - country
           config:
             where: client_name is not null and country is not null

The where config would filter out the null-y ones.
For now, given the workaround possible, I'm going to tentatively decline this one (but leave it open). If other folks also come across this and would find it useful, I'm definitely willing to reconsider, but the fact that it's been out in the world as-is for this long without issue makes me think that adding the extra complexity probably isn't worth it.


compile error

Operating system or device - Godot version:
github branch master code
Issue description (what happened, and what was expected):
c:\godot\thirdparty\libvpx\vpx_dsp/vpx_dsp_common.h(39) : error C2054: 在“inlin
e”之后应输入“(”
c:\godot\thirdparty\libvpx\vpx_dsp/vpx_dsp_common.h(39) : error C2085: “clip_pi
xel”: 不在形参表中
c:\godot\thirdparty\libvpx\vpx_dsp/vpx_dsp_common.h(39) : error C2143: 语法错误
: 缺少“;”(在“{”的前面)
c:\godot\thirdparty\libvpx\vpx_dsp/vpx_dsp_common.h(43) : error C2054: 在“inlin
e”之后应输入“(”
c:\godot\thirdparty\libvpx\vpx_dsp/vpx_dsp_common.h(43) : error C2085: “clamp”
: 不在形参表中
Steps to reproduce:
scons p=windows
Link to minimal example project (optional but very welcome):

Please run with LC_ALL=C scons p=windows to get errors in English.
We also need more information: what compiler are you using, in what version? What is your OS, in what version? etc.

My OS     Windows 7       Use Visual Studio 2013 to compile

CC @zaps166.

Error code translations (thanks google):
error C2054: expected '(' to follow 'inline'
error C2085: 'clip_pixel' : not in formal parameter list
error C2143: syntax error : missing 'token1' before 'token2'
error C2054: expected '(' to follow 'inline'
error C2085: 'clamp' : not in formal parameter list

(provided the error codes from MSVC 2015 are the same as in 2013)

Can't compile on both: MSVC 2013 and 2015 ?

Yes Compilation failure Syntax error

@zaps166 The report is only about MSVC 2013. I mentioned 2015 only because I was looking at its docs to translate the error codes.

Probably MSVC 2013 doesn't support inline in C code...
INLINE is defined as inline in vpx_config.h, line 12. Probably MSVC 2013 needs to define as __inline or __forceinline.
@cjmxp Could you replace #define INLINE inline by #define INLINE __inline (thirdparty/libvpx/vpx_config.h line 12) and try again?

Modify the code to #define INLINE __inline
Compile through

#7122 Please test :)


General context preprocessing function shared across model helpers

The SyntaxGym PR (#91 ) is stress-testing the capacity for model helpers to take multi-part contexts. I realized we needed to add a few context cleaning operations. This PR refactors that context cleaning into a function brainscore_language.utils.preprocessing.prepare_context, and implements it across all three current model helpers.

sorry for delay. looks good to me as well!


[FEAT] cloze overlapping

Is your feature request related to a problem? Please describe.
When reviewing a multiple cloze card, it would be great to have the option to use a cloze overlapping, so all ==highlights== get hidden away.
Describe the solution you'd like
Having this card here:
#cloze

Condition 1: ==explanation for 1==

Condition 2: ==explanation for 2==

Condition 3: ==explanation for 3==

Condition 4: ==explanation for 4==

It would be great to have all explanations hidden away.
Additional context
Feature as an alternative to a fixed chain repetition.

how's life coming along @st3v3nmw? :)
I just aquired 1.100 flashcards, that want to get ported to obsidian-spaced-repitition and would be looking forward to using cloze overlapping. 😇🙏

This would be awesome, esp. if this can be done linewise like

Nouns are words for people, animals, places, or things.

So I know beforehand I have to complete 4 items.

Still in favour :)

any news about this maybe?

Hi @MotaOcimar, I'm looking at all the issues you referenced in your PR https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/943 to gain an understanding as part of reviewing your great contribution.
I believe that the example within this issue would be satisfied with:
Condition 1: ==explanation for 1==[^1]

Condition 2: ==explanation for 2==[^1]

Condition 3: ==explanation for 3==[^1]

Condition 4: ==explanation for 4==[^1]

I.e. specifying the same sequence number 1 in each deletion. Is that correct?
Hi @mkschulze for clarity, I'm wondering why you use the term "overlapping" in your description. Perhaps I have missed something, but can't see anything overlapping.

@ronzulu I think what I was looking for is just having multiple ==HIGLIGHTS== hidden by the cloze instruction. So that it "overlaps" or covers all such instructions on the card. Maybe not the perfect word for it.

Hi @mkschulze thanks for the clarification.

Hi @ronzulu!
Thank you for taking a look at the issues related to Clozes!
Regarding the solution for this issue, I had the same understanding as you. Marking all clozes with the sequence number 1 seems satisfactory, and there would be no need to use the "overlapping" functionality.
Also, thank you @mkschulze for staying active here for clarifications!
Best,
Ocimar

Hi,
I've just made a release v1.13.0 that ships with custom cloze patterns 🥳 all thanks to #943. The updated documentation is live here.
I've tested the release but not as extensively as I normally would. Perhaps we need a beta version of the plugin? That being said, I'm on standby to fix bugs ASAP. Just give me a shout.
Cheers.

Interesting, will check it out. Thx! For now I guess we can cloze here! :D


Unable to provision K8s 1.19 cluster with firewalld enabled when using Calico, Canal, or Flannel

What kind of request is this (question/bug/enhancement/feature request):
Bug
Steps to reproduce (least amount of steps as possible):
In Rancher, update rke-metadata-config to the following:
{
  "refresh-interval-minutes": "1440",
  "url": "https://raw.githubusercontent.com/Oats87/kontainer-driver-metadata/k8s-1-19-v2.5/data/data.json"
}

Refresh Kubernetes metadata
Prepare 1 node with Oracle Linux 7.7 by following the documentation: https://rancher.com/docs/rancher/v2.x/en/installation/options/firewall/
(Or use this AMI which has ports opened: ami-06dd5f94499093e3d)
In Rancher, add a v1.19.1-rancher1-1 custom cluster. 1 node, all roles using the node.
Result:
Cluster is stuck provisioning:

Error in kubelet:
E0910 20:10:19.442169   25373 pod_workers.go:191] Error syncing pod c658b6ca-fbff-42e0-a3aa-f79e02f26a2c ("cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"), skipping: failed to "StartContainer" for "cluster-register" with CrashLoopBackOff: "back-off 5m0s restarting failed container=cluster-register pod=cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"
I0910 20:10:31.441910   25373 topology_manager.go:219] [topologymanager] RemoveContainer - Container ID: 23ea099c02a5e01f00adc5e7ae2cc098b1dd3ff3fa2f4f9005574c38b8b8fe78
E0910 20:10:31.442379   25373 pod_workers.go:191] Error syncing pod c658b6ca-fbff-42e0-a3aa-f79e02f26a2c ("cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"), skipping: failed to "StartContainer" for "cluster-register" with CrashLoopBackOff: "back-off 5m0s restarting failed container=cluster-register pod=cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"
I0910 20:10:44.441995   25373 topology_manager.go:219] [topologymanager] RemoveContainer - Container ID: 23ea099c02a5e01f00adc5e7ae2cc098b1dd3ff3fa2f4f9005574c38b8b8fe78
E0910 20:10:44.442565   25373 pod_workers.go:191] Error syncing pod c658b6ca-fbff-42e0-a3aa-f79e02f26a2c ("cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"), skipping: failed to "StartContainer" for "cluster-register" with CrashLoopBackOff: "back-off 5m0s restarting failed container=cluster-register pod=cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"
I0910 20:10:58.442061   25373 topology_manager.go:219] [topologymanager] RemoveContainer - Container ID: 23ea099c02a5e01f00adc5e7ae2cc098b1dd3ff3fa2f4f9005574c38b8b8fe78
E0910 20:10:58.442582   25373 pod_workers.go:191] Error syncing pod c658b6ca-fbff-42e0-a3aa-f79e02f26a2c ("cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"), skipping: failed to "StartContainer" for "cluster-register" with CrashLoopBackOff: "back-off 5m0s restarting failed container=cluster-register pod=cattle-cluster-agent-987c678c-77rkl_cattle-system(c658b6ca-fbff-42e0-a3aa-f79e02f26a2c)"

Other details that may be helpful:
Environment information

Rancher version (rancher/rancher/rancher/server image tag or shown bottom left in the UI):rancher\rancher:master-head version 198ec5b
Installation option (single install/HA): HA

Cluster information

Cluster type (Hosted/Infrastructure Provider/Custom/Imported): Custom
Kubernetes version (use kubectl version): v1.19.1-rancher1-1

gz#14269

The error reported for the cluster is similar to https://github.com/rancher/rancher/issues/28836 . But in this case , we are not able to recover from this error.

This error is due to changes in port requirements in firewalld.
Oracle Linux works with ports opened (https://rancher.com/docs/rancher/v2.x/en/installation/options/firewall/) using k8s v1.18.x. On rancher\rancher:master-head version 198ec5b and rancher\rancher:v2.4.8

This is an issue in any EL7 operating system where firewalld is running. This includes RHEL 7.x and CentOS 7.
The root appears to be caused by a change in where Calico places the Policy explicitly accepted packet rule. In Calico 3.16.x, this rule is placed at the end of the FORWARD chain, i.e.
-A FORWARD -m comment --comment "cali:S93hcgKJrXEqnTfs" -m comment --comment "Policy explicitly accepted packet." -m mark --mark 0x10000/0x10000 -j ACCEPT

whereas on earlier versions of Calico, it was on the cali-FORWARD chain:
-A cali-FORWARD -m comment --comment "cali:MH9kMp5aNICL-Olv" -m comment --comment "Policy explicitly accepted packet." -m mark --mark 0x10000/0x10000 -j ACCEPT

This change was implemented for: https://github.com/projectcalico/felix/pull/2424 which is an orthogonal issue to the current one at hand.
By appending this rule to the cali-FORWARD chain, traffic would automatically be accepted, and things "worked". Now that the Policy explicitly accepted packet is at the end of the FORWARD chain, there is a firewalld-inserted rule that can now blackhole traffic:
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

which is inserted before the rest of the chain i.e.:
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -s <IP_ADDRESS>/16 -j ACCEPT
-A FORWARD -d <IP_ADDRESS>/16 -j ACCEPT
-A FORWARD -m comment --comment "cali:S93hcgKJrXEqnTfs" -m comment --comment "Policy explicitly accepted packet." -m mark --mark 0x10000/0x10000 -j ACCEPT

and thus, the traffic is never able to make it to the final ACCEPT rule as it is dropped instead.
Further investigation will need to be done to determine the best course of action to mitigate this, as Calico is advertised as "not working well with firewalld" in the first place.

One thing to note is that our documentation for firewalld rules to add never appears to have worked with clusters using only Flannel, for similar reasons.

We also have this problem using iptables. After upgrading to Rancher 2.5.1 and kubernetes 1.19.1, DNS resolution and the overlay network stopped working. Stopping iptables on all nodes fixed the issue.
Versions:
Rancher: 2.5.1
Kubernetes: 1.19.1
iptables v1.4.21
Some logs
bash-4.2$ kubectl logs --namespace=kube-system -l k8s-app=kube-dns
.:53
[INFO] plugin/reload: Running configuration MD5 = 7b85fbe9b4156cf64b768261d4ea6e3b
CoreDNS-1.7.0
linux/amd64, go1.14.4, f59c03d
CoreDNS-1.7.0
linux/amd64, go1.14.4, f59c03d
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:56868-><IP_ADDRESS>:53: read: no route to host
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:41408-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:46917-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:47695-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:57134-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:57679-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:52947-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:36609-><IP_ADDRESS>:53: read: no route to host

Also the test in https://rancher.com/docs/rancher/v2.x/en/troubleshooting/networking/#check-if-overlay-network-is-functioning-correctly outputed that none of the nodes could reach any of the other nodes

We also have this problem using iptables. After upgrading to Rancher 2.5.1 and kubernetes 1.19.1, DNS resolution and the overlay network stopped working. Stopping iptables on all nodes fixed the issue. We are using a custom RKE cluster on CentOS machines
Versions:
Rancher: 2.5.1
Kubernetes: 1.19.2
iptables v1.4.21
cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

uname -r
3.10.0-1127.13.1.el7.x86_64

Some logs
bash-4.2$ kubectl logs --namespace=kube-system -l k8s-app=kube-dns
.:53
[INFO] plugin/reload: Running configuration MD5 = 7b85fbe9b4156cf64b768261d4ea6e3b
CoreDNS-1.7.0
linux/amd64, go1.14.4, f59c03d
CoreDNS-1.7.0
linux/amd64, go1.14.4, f59c03d
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:56868-><IP_ADDRESS>:53: read: no route to host
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:41408-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:46917-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:47695-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:57134-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:57679-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:52947-><IP_ADDRESS>:53: i/o timeout
[ERROR] plugin/errors: 2<PHONE_NUMBER>289819923.6920671835383681148. HINFO: read udp <IP_ADDRESS>:36609-><IP_ADDRESS>:53: read: no route to host

Also the test in https://rancher.com/docs/rancher/v2.x/en/troubleshooting/networking/#check-if-overlay-network-is-functioning-correctly outputed that none of the nodes could reach any of the other nodes

This is more or less expected behavior, and comes with using Calico v3.16.x+

@Oats87 -- forgive me for not being that familiar with Calico yet, but can you point me in the direction of info regarding Calico 3.16x. and that being expected behaviour?
Have firewalls turned off on all my nodes because of this, and it makes me kinda uncomfortable. Would like more info on what works in the security sense.

I'm not sure if this is related but we ran into issues as wel with CentOS7 and iptables enabled. Our problem seemed that calico did not properly set up the routes. Some nodes had a missing route to the services network <IP_ADDRESS>/16. So I manually set the route with ip route add <IP_ADDRESS>/16 dev flannel.1.

I have run into this issue was well. While looking into it I see that this was updated:
https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/node-requirements/

Some distributions of Linux derived from RHEL, including Oracle Linux, may have default firewall rules that block communication with Helm. We recommend disabling firewalld. For Kubernetes 1.19, firewalld must be turned off.

Is there some explanation on why this can not be fixed, or if there is something else that needs to be used to ensure security on the host? Sorry if I am missing something.

I was able to get a 1.19 cluster working. I use terraform with xenorchestra provider on our on prem pool. I created a new vm to with the intention of turning it into a template. I switched from centos 7 to centos 8 and then switched from firewalld to ufw. After making sure everything was good to go, I stopped the vm and turned it into a template.
Then in my terraform plan (is it called a plan?) I set this as part of the cloud-init portion
#cloud-init
runcmd:
...
 - sudo ip route add <IP_ADDRESS>/16 dev flannel.1
 - sudo /sbin/iptables -t nat -C POSTROUTING -s <IP_ADDRESS>/16 -d <IP_ADDRESS>/16 -j RETURN --wait
 - sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.5.2 ...
...

After this I got a working k8s 1.19 cluster with centos 8 hosts. Hope this helps someone until the issue is resolved.

If it works with iptables/ufw when you add the route, I'll take a look at that. Using firewalld would be nice, but if I have to configure an alternative that's better than just no firewall.
Keep hoping I can find more info on why flannel (I assume) and firewalld don't get along with each other.

OK, I am sure that the steps I am taking do fix this problem.
During my setup of the cluster I forgot a couple of things, so I made the changes and restarted the hosts, and the failure started happening again. The route was missing. I figured out that runcmd only runs on first time vm start up.
After I added the following to my terraform plan
bootcmd:
 - sudo ip route add <IP_ADDRESS>/16 dev flannel.1
 - sudo /sbin/iptables -t nat -C POSTROUTING -s <IP_ADDRESS>/16 -d <IP_ADDRESS>/16 -j RETURN --wait

And redoing the cluster, it seems to work every time now. This happens to me every so often https://github.com/rancher/rancher/issues/28768 which caused me to think I was still having problems, but like they said in the thread if you wait long enough (20-30 minutes) things will start working.

This is an ongoing issue, with the route missing and the firewalld errors with CentOS7 clusters. Is there any new guidance for this issue? Currently the "best" work around seems to be to disable firewalld.

This is an ongoing issue, with the route missing and the firewalld errors with CentOS7 clusters. Is there any new guidance for this issue? Currently the "best" work around seems to be to disable firewalld.

For me it is not an option to deploy a k8s cluster without host firewall.
My 'solution' so far:
dnf install ufw -y
systemctl disable --now firewalld.service
<add the ports you need to ufw, example>
sudo ufw allow 30000:32767/tcp
systemctl enable --now ufw.service

These commands are also needed, would be better to write these to the network scripts but I have not gotten to it. These will not persist after a reboot.
sudo ip route add <IP_ADDRESS>/16 dev flannel.1
sudo /sbin/iptables -t nat -C POSTROUTING -s <IP_ADDRESS>/16 -d <IP_ADDRESS>/16 -j RETURN --wait

This allows me to create a k8s cluster using centos 8.3, fully up to date. As well as k8s 1.19.6
There seems to be a fundamental issue with firewalld because of iptables. I don't understand why switching from firewalld to UFW works around this.
I even setup a k3s cluster to see if that would work with firewalld, and it would not.
I have started testing out this cluster, adding storage classes (for this cluster, portworx), metallb, and other workloads.
So far it is looking good.
Take a look at this as well: https://docs.docker.com/network/iptables/
This should help you with centos 7 as well.

For me it is not an option to deploy a k8s cluster without host firewall.
My 'solution' so far:
dnf install ufw -y
systemctl disable --now firewalld.service
<add the ports you need to ufw, example>
sudo ufw allow 30000:32767/tcp
systemctl enable --now ufw.service

These commands are also needed, would be better to write these to the network scripts but I have not gotten to it. These will not persist after a reboot.
sudo ip route add <IP_ADDRESS>/16 dev flannel.1
sudo /sbin/iptables -t nat -C POSTROUTING -s <IP_ADDRESS>/16 -d <IP_ADDRESS>/16 -j RETURN --wait

This allows me to create a k8s cluster using centos 8.3, fully up to date. As well as k8s 1.19.6
There seems to be a fundamental issue with firewalld because of iptables. I don't understand why switching from firewalld to UFW works around this.
I even setup a k3s cluster to see if that would work with firewalld, and it would not.
I have started testing out this cluster, adding storage classes (for this cluster, portworx), metallb, and other workloads.
So far it is looking good.
Take a look at this as well: https://docs.docker.com/network/iptables/
This should help you with centos 7 as well.

I had the same issue on CentOS 7 nodes (fully patched as of 8.1.2021) that I was installing a new RKE cluster on.
If I enable masquerade on my default firewalld zone (sudo firewall-cmd --add-masquerade --permanent;sudo firewall-cmd --reload) my overlay network tests work as expected.
I have not added any route or anything else.
Hope this helps.

I had the same issue on CentOS 7 nodes (fully patched as of 8.1.2021) that I was installing a new RKE cluster on.
If I enable masquerade on my default firewalld zone (sudo firewall-cmd --add-masquerade --permanent;sudo firewall-cmd --reload) my overlay network tests work as expected.
I have not added any route or anything else.
Hope this helps.

@finnzi This does look like it fixes the issue. I am able to deploy a cluster and deploy an app to do a quick test. I will redeploy the intended cluster with this change and start to build it out.

@finnzi This does look like it fixes the issue. I am able to deploy a cluster and deploy an app to do a quick test. I will redeploy the intended cluster with this change and start to build it out.

This might be a bad idea....the support team at Rancher pointed out that this might masquerade the IP addresses of a container talking to another container....so you might want to apply this 'workaround' carefully and wait for a official solution ;-)

This might be a bad idea....the support team at Rancher pointed out that this might masquerade the IP addresses of a container talking to another container....so you might want to apply this 'workaround' carefully and wait for a official solution ;-)

Has anyone tried running 1.19 with iptables instead of firewalld?

Has anyone tried running 1.19 with iptables instead of firewalld?

@andrew-landsverk-win I tried that, and I was not able to get a better/working result.
@finnzi Do you happen to have a link to Rancher stating that? Would help me with research into the problem more. So far I have not observed any issues with the cluster, though nothing is cutover from prod yet. Still testing.

@andrew-landsverk-win I tried that, and I was not able to get a better/working result.
@finnzi Do you happen to have a link to Rancher stating that? Would help me with research into the problem more. So far I have not observed any issues with the cluster, though nothing is cutover from prod yet. Still testing.

@andrew-landsverk-win I tried that, and I was not able to get a better/working result.
@finnzi Do you happen to have a link to Rancher stating that? Would help me with research into the problem more. So far I have not observed any issues with the cluster, though nothing is cutover from prod yet. Still testing.

Sorry - don't have any public reply - however they state on the setup page for Rancher that with Kubernetes 1.19 firewalld should be disabled: https://rancher.com/docs/rancher/v2.x/en/installation/requirements/

@andrew-landsverk-win I tried that, and I was not able to get a better/working result.
@finnzi Do you happen to have a link to Rancher stating that? Would help me with research into the problem more. So far I have not observed any issues with the cluster, though nothing is cutover from prod yet. Still testing.

Sorry - don't have any public reply - however they state on the setup page for Rancher that with Kubernetes 1.19 firewalld should be disabled: https://rancher.com/docs/rancher/v2.x/en/installation/requirements/

This might be a bad idea....the support team at Rancher pointed out that this might masquerade the IP addresses of a container talking to another container....so you might want to apply this 'workaround' carefully and wait for a official solution ;-)

Just FYI - was working with network policies the other day and ended up spending a lot of time debugging - my "workaround" NAT'ed all pod-to-pod communications with the node address the src pod was coming from (if the pods were not running on the same node). Be warned ;-)

We were facing the problem described by @Oats87 above.
As we are not (yet) allowed to disable firewalld, we setup a workaround. As explained by @Oats87 the issue happens on iptable's FORWARD chain, where firewalld rules conflict with rules set by calico :
> sudo iptables -L FORWARD -v --line-numbers
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1      299 16801 cali-FORWARD  all  --  any    any     anywhere             anywhere             /* cali:wUHhoiAYhphO9Mso */
2      360 20430 KUBE-FORWARD  all  --  any    any     anywhere             anywhere             /* kubernetes forwarding rules */
3      360 20430 KUBE-SERVICES  all  --  any    any     anywhere             anywhere             ctstate NEW /* kubernetes service portals */
4      360 20430 DOCKER-USER  all  --  any    any     anywhere             anywhere
5      360 20430 DOCKER-ISOLATION-STAGE-1  all  --  any    any     anywhere             anywhere
6        0     0 ACCEPT     all  --  any    docker0  anywhere             anywhere             ctstate RELATED,ESTABLISHED
7        0     0 DOCKER     all  --  any    docker0  anywhere             anywhere
8        0     0 ACCEPT     all  --  docker0 !docker0  anywhere             anywhere
9        0     0 ACCEPT     all  --  docker0 docker0  anywhere             anywhere
10       0     0 ACCEPT     all  --  any    any     anywhere             anywhere             ctstate RELATED,ESTABLISHED
11       0     0 ACCEPT     all  --  lo     any     anywhere             anywhere
12     360 20430 FORWARD_direct  all  --  any    any     anywhere             anywhere
13     360 20430 FORWARD_IN_ZONES_SOURCE  all  --  any    any     anywhere             anywhere
14     360 20430 FORWARD_IN_ZONES  all  --  any    any     anywhere             anywhere
15     360 20430 FORWARD_OUT_ZONES_SOURCE  all  --  any    any     anywhere             anywhere
16     360 20430 FORWARD_OUT_ZONES  all  --  any    any     anywhere             anywhere
17       0     0 DROP       all  --  any    any     anywhere             anywhere             ctstate INVALID
18     360 20430 REJECT     all  --  any    any     anywhere             anywhere             reject-with icmp-host-prohibited
19       0     0 ACCEPT     all  --  any    any     <IP_ADDRESS>/16         anywhere
20       0     0 ACCEPT     all  --  any    any     anywhere             <IP_ADDRESS>/16
21       0     0 ACCEPT     all  --  any    any     anywhere             anywhere             /* cali:S93hcgKJrXEqnTfs */ /* Policy explicitly accepted packet. */ mark match 0x10000/0x10000

Rules 12 to 18 are set by firewalld on startup
Rules 19 to 21 are set later by calico once the calico pods are running (they are not present at machine startup)

The problem is that rule 18 rejects all traffic so that rules 19 to 21 are never reached. As a consequence traffic coming from/going to <IP_ADDRESS>/16 (i.e. the node/pod address space) is not routed by the node. Instead rule 18 is applied which rejects the traffic, causing clients to get a "no route to host" response (reject-with icmp-host-prohibited).
Our workaround is to replicate the rules added by calico to iptable's builtin FORWARD chain (19 to 21) in firewalld's FORWARD_direct chain which is traversed thanks to rule 12. This is done permanently with the following firewalld commands:
# Replicate rule 19 to FORWARD_direct#1
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD_direct 0 -s <IP_ADDRESS>/16 -j ACCEPT
# Replicate rule 20 to FORWARD_direct#2
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD_direct 1 -d <IP_ADDRESS>/16 -j ACCEPT
# Replicate rule 21 to FORWARD_direct#3
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD_direct 2 -m comment --comment "Policy explicitly accepted packet." -m mark --mark 0x10000/0x10000 -j ACCEPT

# Reload the configuration
sudo firewall-cmd --reload

Now when we list the content of the FORWARD_direct direct chain, we should have the following result:
> sudo iptables -L FORWARD_direct -nv --line-numbers
Chain FORWARD_direct (1 references)
num   pkts bytes target     prot opt in     out     source               destination
1        4   225 ACCEPT     all  --  *      *       <IP_ADDRESS>/16         <IP_ADDRESS>/0
2        0     0 ACCEPT     all  --  *      *       <IP_ADDRESS>/0            <IP_ADDRESS>/16
3        0     0 ACCEPT     all  --  *      *       <IP_ADDRESS>/0            <IP_ADDRESS>/0            /* Policy explicitly accepted packet. */ mark match 0x10000/0x10000

This way kubernetes packets are correctly routed and firewalld is still rejecting other packets not matching these rules.
Important:

this fixed only this particular issue in our case. We are not 100% sure whether other rules are conflicting between firewalld/calico. If calico changes/completes these rules or the way it places them, this fix must be reviewed. We do not remove lines 19 to 21 in the FORWARD chain (they are never reached) so we can still compare them to the replicated rules to check whether calico changed them.
the <IP_ADDRESS>/16 address space may need to be adjusted depending on your cluster setup

Hi,
I solved my problem in CentOS 8 by creating a new firewalld zone for kubernetes pods and setting its target to ACCEPT
Commands :
firewall-cmd --permanent --delete-zone=kubernetes_pods
firewall-cmd --permanent --new-zone=kubernetes_pods
firewall-cmd --permanent --zone=kubernetes_pods --set-target=ACCEPT
firewall-cmd --permanent --zone=kubernetes_pods --add-source=<POD SUBNET CIDR>
firewall-cmd --reload

firewall-cmd man :
       --permanent [--zone=zone] --set-target=target
           Set the target of a permanent zone.  target is one of: default, ACCEPT, DROP, REJECT

           default is similar to REJECT, but has special meaning in the following scenarios:

            1. ICMP explicitly allowed

               At the end of the zone's ruleset ICMP packets are explicitly allowed.

            2. forwarded packets follow the target of the egress zone

               In the case of forwarded packets, if the ingress zone uses default then whether or not the packet will be
               allowed is determined by the egress zone.

               For a forwarded packet that ingresses zoneA and egresses zoneB:

               ·   if zoneA's target is ACCEPT, DROP, or REJECT then the packet is accepted, dropped, or rejected
                   respectively.

               ·   if zoneA's target is default, then the packet is accepted, dropped, or rejected based on zoneB's target. If
                   zoneB's target is also default, then the packet will be rejected by firewalld's catchall reject.

            3. Zone drifting from source-based zone to interface-based zone

               This only applies if AllowZoneDrifting is enabled. See firewalld.conf(5).

               If a packet ingresses a source-based zone with a target of default, it may still enter an interface-based zone
               (including the default zone).

Versions :
firewall-cmd --version
0.8.2

uname -r
4.18.0-240.10.1.el8_3.x86_64

cat /etc/redhat-release
CentOS Linux release 8.3.2011

kubectl version
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:28:09Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:20:00Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}

My setup (built with Kubespray using kubernetes 1.20 and calico 3.16.8), the primary problem appears to be these two rules (the last two rules in the FORWARD chain, the first set up by firewalld, the second from Calico):
REJECT     all  --  <IP_ADDRESS>/0            <IP_ADDRESS>/0            reject-with icmp-host-prohibited
ACCEPT     all  --  <IP_ADDRESS>/0            <IP_ADDRESS>/0            /* cali:S93hcgKJrXEqnTfs */ /* Policy explicitly accepted packet. */ mark match 0x10000/0x10000

Adding the same ACCEPT rule before the REJECT rule allows it work.
The problem I see with the solution proposed by @sagarvelankar is that it could result in packets that should be rejected according to network policy setup being accepted.
This is with calico using "Insert" as its FELIX_CHAININSERTMODE setting, so I am not clear why the rule is put at the end rather than earlier.

OK, after a bit of running around and having a working cluster with UFW and no other trickery, we found that Calico policies provide everything we need to enforce security. I had just not dug into it enough.
What we did, create cluster with multi-interface workers, setting the interfaces according to https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/custom-nodes/agent-options/#ip-address-options.
This cluster has NO FIREWALL, no firewalld or ufw. Once the cluster comes up, we then setup Calico policies to protect the public interface. I got help from someone on the team with a much better understanding of networks and security to derive these policies.
So yes, it is possible to have a secure production cluster without a host firewall on the workers. This went against all my instincts.
This may seem obvious to some, but I hope this can help others. I wonder if anyone has and insights/objections to this approach?

Changing the firewalld zone target to default can be a workaround
calico-issuecommet

Disabling the firewall causes our setup to be non-CIS compliant as CIS requires

3.6.1 Ensure iptables is installed
3.6.2 Ensure default deny firewall policy
3.6.3 Ensure loopback traffic is configured
3.6.4 Ensure outbound and established connections are configured
3.6.5 Ensure firewall rules exist for all open ports

Inspired by earlier comments we added the following saltstack state (https://docs.saltproject.io/en/latest/ref/states/all/salt.states.iptables.html#salt.states.iptables.delete):
iptables-FORWARD-remove-REJECT:
  iptables.delete:
    - chain: FORWARD
    - table: filter
    - jump: REJECT
    - reject-with: icmp-host-prohibited
    - save: False

I don't know the exact iptables command, but removing this line from the FORWARD chain seems to fix the issue. I hope it helps someone.

For Calico (E.g. a RKE clsuter for Rancher with mostly defaults), these rules work: (It allows all traffic to/from the Calico interfaces.
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 99 -o cali+ -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 99 -i cali+ -j ACCEPT
firewall-cmd --direct --add-rule ipv4 filter FORWARD 99 -o cali+ -j ACCEPT
firewall-cmd --direct --add-rule ipv4 filter FORWARD 99 -i cali+ -j ACCEPT

Since direct rules are now deprecated, does anyone have an idea how to convert this set of direct rules (which worked perfectly for us) to a firewalld policy (https://firewalld.org/documentation/man-pages/firewalld.policies.html)?
We're attempting to translate the same to a firewalld policy that can be applied to el8+ systems with nftables.

Or a rich rule (https://firewalld.org/documentation/man-pages/firewalld.richlanguage.html), for what matters.

firewall-cmd --permanent --delete-zone=kubernetes_pods
firewall-cmd --permanent --new-zone=kubernetes_pods
firewall-cmd --permanent --zone=kubernetes_pods --set-target=ACCEPT
firewall-cmd --permanent --zone=kubernetes_pods --add-source=<POD SUBNET CIDR>
firewall-cmd --reload

Switching to this works as well, but it's easier to translate if you use linux-system-roles.firewall or similar things on Red Hat based systems. This is what we have in ansible:
firewall:

  - zone: kubernetes-pods
    state: present
    permanent: true

  - zone: kubernetes-pods
    target: ACCEPT
    source: "{{ rancher_overlay_network_cidr }}"
    state: enabled
    permanent: true

firewall-cmd --permanent --delete-zone=kubernetes_pods
firewall-cmd --permanent --new-zone=kubernetes_pods
firewall-cmd --permanent --zone=kubernetes_pods --set-target=ACCEPT
firewall-cmd --permanent --zone=kubernetes_pods --add-source=<POD SUBNET CIDR>
firewall-cmd --reload

Switching to this works as well, and it's easier to translate if you use linux-system-roles.firewall or similar things on Red Hat based systems. This is what we have in ansible:
firewall:

  - zone: kubernetes-pods
    state: present
    permanent: true

  - zone: kubernetes-pods
    target: ACCEPT
    source: "{{ rancher_overlay_network_cidr }}"
    state: enabled
    permanent: true

Works for both iptables (el7) and nftables (el8+/fedora).

As one replaces el7 nodes with el8/9 in a cluster, one by one, this last bit about using the same configuration for all becomes all that more vital.
Side note: before we resolved it in this very way, we had suspected Felix to maybe recognise the backend improperly. See FELIX_IPTABLESBACKEND with Legacy, NFT, Auto at https://projectcalico.docs.tigera.io/archive/v3.19/reference/felix/configuration. Our first attempt of adding FelixConfiguration resources per node (node.<nodename>) didn't do anything, as the environment variables have higher precedence, but luckily changing FELIX_LOGSEVERITYSCREEN to Info already revealed felix merrily acting on nft where appropriate. What really mattered was a reboot to clean out all the various attempts of the migration.
Long story short: enable some verbosity on the calico-node daemonset via the environment variables, and make sure to reboot the node when making significant changes.

如果并并不是firewalld的重度用户可以参考我的办法，使用ufw替换掉firewalld，我替换之后整个集群运行正常。


Add transferFrom test suites

Can you merge the feature branch into this PR so that the diff is clean.

@saturnial  still WIP, will do afterwards

Thx for adding the label


bug: pr guardrails linting deleted files

Describe the bug
Old issue reoccurring. On creating Pull Request, es-lint is trying to lint deleted files and failing.
Ref: #81

Closing as done.


Display embedded man pages for built-in commands.

This changes cargo help COMMAND to display the man page for the given command.  cargo COMMAND --help continues to show the basic clap output.
The man pages are embedded in the executable in a compressed format. There's also a copy of the man pages in text format for platforms that do not have the man executable (like Windows).
It is unfortunate to check in more pre-generated files. I hope in the future that the usage of asciidoc can be replaced with something else (possibly a custom markdown-based solution).
cc #6104

r? @alexcrichton
(rust_highfive has picked a reviewer for you, use r? to override)

I've been messing with checking on CI, and came to the realization that man (and sometimes asciidoctor itself) produces different output on different systems.
I think that emphasizes that it will be increasingly difficult for people to contribute to the documentation (if they don't have the exact same setup).  I've been concerned about it in the past, but I feel like this is a tipping point.
Would you be opposed to a custom solution using Rust and markdown (to replace the asciidoctor stuff)?  I don't know exactly what that would look like, or how much code it would be. Comparing to the html renderer and asciidoctor's manpage converter, I would hope it is roughly the same magnitude (under 1,000 lines).
I would probably still lean towards pre-generated files (instead of embedding pulldown-cmark into cargo itself, and rendering at runtime).  I would probably just add a utility crate that can generate the rendered files.

Gah bummer!
I don't think it's the end of the world to have a custom solution here, but it's sort of a bummer that we have to make something just for Cargo. Ideally it'd be shared by other CLI tooling elsewhere or such. (Cargo doesn't seem particularly unique in this regard).
As you mentioned though it's probably not a huge feature or implementation, so I think vendoring our own should be ok.

It seems reasonable at least to perhaps have it out-of-repo (or make that an explicit "goal") -- I imagine at the very least, we'll probably want similar-ish tooling perhaps for rust{doc,c} --help eventually.

:umbrella: The latest upstream changes (presumably #8577) made this pull request unmergeable. Please resolve the merge conflicts.

OK, I have rebased after #8577, and I think this should be ready to go.  I haven't done much testing on less-common platforms and terminals (just mac/windows/linux/freebsd with a variety of common terminals). I'm kinda hoping if people run into problems, they can file an issue.

@bors: r+
Looks great to me 👍

:pushpin: Commit 0d6881c5bce252df34d4a4263878e78b8f56efab has been approved by alexcrichton

:hourglass: Testing commit 0d6881c5bce252df34d4a4263878e78b8f56efab with merge 2732539e8548fd0db65ad51ceb049f23d2f3b931...

:sunny: Test successful - checks-actions
Approved by: alexcrichton
Pushing 2732539e8548fd0db65ad51ceb049f23d2f3b931 to master...


parse implicit discard '..' as '$.list_pattern_tail'

I noticed this syntax in the language tour docs and saw that it's throwing up an (ERROR) node currently:
case xs {
  [[]] -> "The only element is an empty list"
  [[], ..] -> "The 1st element is an empty list"
  [[4], ..] -> "The 1st element is a list of the number 4"
  other -> "Something else"
}

I think the gleam parser has a clause for this case here, so I went and made the binding pattern optional

Ah, great catch! :100: The lines you specified return a parse_error, I think you meant the Some(None) match arm directly below that one :grin:


feat: Embed TryIt in Articles

Closes: https://github.com/stoplightio/elements/issues/836
Note: The actual change is in http part of CodeComponent that can be seen in first commit. GH doesn't detect file rename here unfortunately.

@marcelltoth thanks for the comments. I've updated it and added a rendering test showing that it actually works.


CUDA out of memory

单卡 10g 为啥会不够 predict一次

RuntimeError: CUDA out of memory. Tried to allocate 76.00 MiB (GPU 0; 10.76 GiB total capacity; 9.57 GiB already allocated; 74.81 MiB free; 9.70 GiB reserved in total by PyTorch)

Did you run predict.py?
When I inferring model, main.py --eval has no problem with GPU memory, but when I run predict.py, the memory issue was corrupted like you.

I also suffer from the same problem, but it works after adding @torch.no_grad() above the def main(args) in predict.py (line 123)

yes, run predict.py!

Thanks to ChulyoungKwak's answer, because I usually work in A100 GPU, so I missed this problem. If the GPU memory is not enough, @torch.no_grad() is a good solution.


DefinePlugin bug

Bug report
Today I tried to use DotenvPlugin but it didn't work. I've looked up the issue and from my research the problem is within DefinePlugin initialization.

What is the current behavior?
First I tried to follow the documentation and create some env variables:
new webpack.DefinePlugin({
  'process.env.TEST': '"TEST"'
});

but it didn't work i.e. process.env was empty.
Instead I did:
new webpack.DefinePlugin({
  'process.env': {
    NODE_ENV: '"TEST"',
  }
});

and it did work. Unlucky for me dotenv-webpack is using the first style of initializing the plugin with variables.
If the current behavior is a bug, please provide the steps to reproduce.
Just use plugin DefinePlugin as follows:
new webpack.DefinePlugin({
  'process.env.TEST': '"TEST"'
});

What is the expected behavior?
It does work as expected as this point says
https://webpack.js.org/plugins/environment-plugin/#usage in documentation.

Other relevant information:
webpack version:  4.43.0
Node.js version: v10.21.0
Operating System: Ubuntu 20.04
Additional tools: Docker / docker-compose

You should not write process.env in your code but directly process.env.TEST instead.

As I said, I tried following the docs and do:
new webpack.DefinePlugin({
  'process.env.TEST': '"TEST"'
});

but it didn't work, and the plugin dotenv-webpack does not work as well at least for me.

Please report the issue to dotenv-webpack plugin

It's expected that process.env doesn't work. Only process.env.TEST works.


quill:0.2.0

I am submitting

[ ] a new package
[x] an update for a package

This update adds new features and fixes some bugs introduced by breaking changes in recent Typst versions.

I have read and followed the submission guidelines and, in particular, I

[x] selected a name in conformance with the guidelines
[x] added a typst.toml file with all required keys
[x] added a README.md with documentation for my package
[x] have chosen a license and added a LICENSE file or linked one in my README.md
[x] ensured that my submission does not infringe upon the rights of a third party
[x] tested my package locally on my system and it worked
[x] named this PR as name:version of the submitted package
[x] agree that my package will not be removed without good reason

Hi @laurmaedje ,
I think something is wrong. Just importing the new version, #import "@preview/quill:0.2.0" already results in the error essage
failed to decompress package (unexpected end of file)
Could you look into the issue? Before submission I tested the package locally and everything worked fine.

I can't reproduce the error. It works for me both locally and in the web app.

It does indeed work locally

The error in the Web App occurs only in Microsoft Edge and only in exactly one (my main) user profile. Incognito mode and other profiles work fine. I'll wait and see if the issue is resolved by itself. Restarting the computer did not help.

Maybe wrong data is saved in your browser cache? Although I don't know where that wrong data would come from.

I suppose that was the case, clearing the cache resolved the issue 👍


Deprecated mkdocs.yml Structure

Latest build is failing: https://readthedocs.org/builds/frameworkbenchmarks/2960689/
Looks like they're deprecating the structure we have for mkdocs.yml.

mkdocs will generate a sitemap (http://www.sitemaps.org) for the respective site.
A sitemap consists of urls and each url includes a "loc" child entry. This entry is the
url of the page and must begin with the protocol and end with a trailing slash, if your web server requires it (see http://www.sitemaps.org/protocol.html#locdef).
mkdocs uses the site_url variable to generate the respective loc entries (see https://github.com/mkdocs/mkdocs/blob/3c6a66b38825dc409f1f8e000bd041f57ee225be/mkdocs/templates/sitemap.xml#L14) and therefore the site_url variable must either be empty or include a protocol.
So, possible solutions to fix this issue are

setting site_url to http://frameworkbenchmarks.readthedocs.org/en/latest/Project-Information/
not setting the site_variable to any value


segfault adding a site

~/dev/support/craft2.support.test
❯ nitro add craft2.support.test
What should the hostname be? [craft2.support.test]: █
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1465daf]

goroutine 1 [running]:
github.com/craftcms/nitro/internal/helpers.FindWebRoot.func1(0xc000024280, 0x3f, 0x0, 0x0, 0x162ca60, 0xc00011c060, 0x0, 0xc00011a018)
	/Users/jasonmccallister/go/src/github.com/craftcms/nitro/internal/helpers/webroot.go:12 +0x2f
path/filepath.Walk(0xc000024280, 0x3f, 0xc000197758, 0xc000197768, 0x100bbab)
	/usr/local/Cellar/go/1.14.2_1/libexec/src/path/filepath/path.go:404 +0x6a
github.com/craftcms/nitro/internal/helpers.FindWebRoot(0xc000024280, 0x3f, 0x0, 0x0, 0x0, 0xc0000242c0)
	/Users/jasonmccallister/go/src/github.com/craftcms/nitro/internal/helpers/webroot.go:11 +0x66
github.com/craftcms/nitro/internal/cmd.glob..func1(0x1987be0, 0xc000075740, 0x1, 0x1, 0x0, 0x0)
	/Users/jasonmccallister/go/src/github.com/craftcms/nitro/internal/cmd/add.go:64 +0x1b29
github.com/spf13/cobra.(*Command).execute(0x1987be0, 0xc000075700, 0x1, 0x1, 0x1987be0, 0xc000075700)
	/Users/jasonmccallister/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:826 +0x453
github.com/spf13/cobra.(*Command).ExecuteC(0x198ade0, 0x0, 0x0, 0x0)
	/Users/jasonmccallister/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/jasonmccallister/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/craftcms/nitro/internal/cmd.Execute()
	/Users/jasonmccallister/go/src/github.com/craftcms/nitro/internal/cmd/root.go:53 +0x2d
main.main()
	/Users/jasonmccallister/go/src/github.com/craftcms/nitro/cmd/cli/main.go:8 +0x20

nitrol.yaml when running this command
name: nitro-local
php: "7.4"
cpus: "1"
disk: 100G
memory: 6G
mounts:
- source: ~/dev/support/craft3.support.test
  dest: /nitro/sites/craft3.support.test
databases:
- engine: mysql
  version: "5.7"
  port: "3306"
- engine: postgres
  version: "12"
  port: "5432"
sites:
- hostname: craft3.support.test
  webroot: /nitro/sites/craft3.support.test/web

I'm seeing the same issue on a new Nitro machine too.
name: nitro
php: "7.4"
cpus: "1"
disk: 30G
memory: 4G
databases:
- engine: mysql
  version: "5.7"
  port: "3306"

Thought it was possibly related to the subdomain sitename (was using app.project.test) but is also an issue for project.test.

I've identified this error and will resolve with the next release, which is most likely going to have breaking changes.


fix(style): Added borders to white buttons (#99)

Proposed Changes

Added borders to white buttons (Proposal for #99)
Closes #99

Checklist

[x] Tested locally
[x] Ran yarn ci to test my code
[x] Did not add any unnecessary changes
[x] All my changes appear after other changes in each file
[x] Included a screenshot (if adding a new button)
[x] 🚀

thanks :) appreciate your work and dedication.

Thank you so much!!!


Return early and display a message when you have an invalid (or missing) github token

Otherwise you get generated output that looks correct, but is useless.

Seems easy: https://onecompiler.com/questions/3uxsn58yz/how-to-test-a-github-access-token-is-valid - we just need public scopes, so we can test something like issues or repos


ISPN-14792 Remove Security Integration tests with WildFly

https://issues.redhat.com/browse/ISPN-14792

Merged, thanks


Check that images have the correct layers

Fixes https://github.com/chainguard-dev/apko/issues/716

Testing against the known-bad commits:
$ crane export --platform linux/amd64 "${REF}" | tar -Ox etc/apk/arch | grep x86_64
$ echo $?
1


P0653R2 Utility to convert a pointer to a raw pointer

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0653r2.html

実装済み


Notebook Examples

The current examples are in the form of scripts. To make easier and more interactive for users of the library it would help to have notebooks demonstrating these examples. For now the notebooks would go under examples folder under branch 2.0 where porting to Python 3+ is happening.

@mpatacchiola Label this as Good first issue

@kamathhrishi @mpatacchiola are these notebooks to be run in Python 2 or 3?  I have it running in Colab for Python 3 but getting errors.

The notebooks are for the Python 3 (Deepgaze 2.0) version.


Cluster Key Vault

This is a documentation for K8S 1.8 Encryption Provider Feature
Ref Docs

Doc: https://docs.google.com/document/d/1JAwPuZg47UhfRVlof-lMw08OJztunW8pvTNxDK3rCF8/edit
Doc: https://docs.google.com/document/d/1T2y-9geg9EfHHtCDYTXptCa-F4kQ0RyiH-c_M1SyD0s/edit
Code: https://github.com/kubernetes/kubernetes/pull/48574

Use Case
Cloud providers will enable users to encrypt Kubernetes' secrets saved in etcd (for 1.8. 1.9++ is expected to add "secrets saved externally").
How will that work on Azure

acs-engine will create clusters with a default Azure Key Vault provisioned by ARM. The key vault name is generated dynamically based on cluster FQDN and is saved in /etc/kubernetes/azure.json and will be used.

if the cluster is not using the newly introduced MSI, the user provided service principal will have create,encrypt and decrypt on vault/keys. if the cluster is using MSI, then VMs' service principals will be have the same permissions (added by the cloud provider as it starts).

The cloud provider will be extended to

Create a well named default key in the cluster key vault  used for encrypting/decrypt etcd secrets
Add permission as stated above.
implement encrypt/decrypt interfaces as needed by Kubernetes.

@jdumars @slack

regarding 2, do agent nodes have the same encrypt/decrypt privilege? Keyvault access policy can only have up to 16 principals added. If agents do need, the msi will not work when cluster size is > 16 (including master).
regarding 3, doesn't that mean cloud provider has "create" or "import' access to keyvault as well?

re 2- (this is yet to be ironed out). VMs' spns has contributor access on the entire RG. they can add then remove themselves. Or try add, fail remove one, add.
re 3 - No create, encrypt and decrypt. I don't think we need import. am i missing something?


fb login done

fb login done at /auth/facebook
express-session as new dependency for maintaining session for all http request

Immediately remove your credentials from secrets-sample.json. The reason secrets.json was made was precisely to hide the credentials. no changes in secrets-sample. It just gives a basic layout of how secrets.json will be. It is not meant for holding information.
Also, squash all your commits into into one

ok i will make the following changes and squash the commits

done changes

@shivanggarg1998 nice! Keep in mind, do not commit changes to yarn.lock in the future.

i added a dependency so i committed yarn.lock too

i added express-session dependency


Add custom armor bonusses when wearing specific other custom armor pieces as well

Currently, custom armor (and all other custom items) can have attribute modifiers. But, these are always the same. It could be interesting to improve these attribute modifiers if the player also equips a related armor piece (but in a different slot).
Simple example: an emerald chestplate should add 8.0 armor if worn without emerald leggings, but should add 9.0 armor if the player also wears emerald leggings (and for instance 10.0 armor if the player wears emerald helmet or boots as well...)
Add similar possibilities for damage resistances and potion effects.

That would be so cool


Java - need a way to add or update scenarios within a Feature file

Is your feature request related to a problem? Please describe.
I have a feature file my.feature. It contains many Scenarios.
I have a program that reads this feature and allows users to a) existing scenarios, and b) add new scenarios.
So when it's done, it provides a gherkin scenario string for the scenario:
  @MyTestTag
  Scenario Outline: Do some stuff!
    Given the user <MyUser> logs in
    Then the user is cool

    Examples:
      | MyUser    |
      | Nick      |

I need to update a scenario or add a scenario within this feature file.
There appears to be no methods within the Gherkin-java sdk to handle this.
Describe the solution you'd like
There should be a way to take a Gherkin text of a scenario and update an existing feature file.
public static void replaceExample(String scenarioName, String scenarioGherkinString, Envelope existingEnvelope) throws IOException {
	IdGenerator idGenerator = new IdGenerator.Incrementing();

	Envelope newEnvelope = Gherkin.fromSources(Arrays.asList(Gherkin.makeSourceEnvelope(scenarioGherkinString, "test.feature")), false, true, false, idGenerator)
			.collect(Collectors.toList()).get(0);

	GherkinDocument gherkinDocument = existingEnvelope.getGherkinDocument();
	List<FeatureChild> features = gherkinDocument.getFeature().getChildrenList();
	Optional<FeatureChild> feature = features.stream().filter(f -> f.getScenario().getName().equals(scenarioName)).findFirst();
	if (feature.isPresent()) {
		// edit scenario in the exisingEnvelope
	} else {
		// add a new scenario to the exisingEnvelope
	}
}

Describe alternatives you've considered
I am debating whether or not I should just do this by hand, instead of using the Gherkin SDK.

Are you looking for a way to convert the GherkinDocument abstract syntax tree back to a string?

Closing due to lack of activity.
Please use the support forums for questions and discussions. We use GitHub issues to track bugs and contributions exclusively.


Add "markdown" visualizator for STRING types

Do you have a (possibly maven based) library in mind which allows markdown -> HTML transformation and maybe syntax highlighting so that it can be used in in an IVisualizer implementation?

Good question... Several years age I used markdown4j: but it seems outdated and not maven. But it seems that following library is good enough: https://github.com/sirthias/pegdown Hopefully it will not bring a lot through dependencies: I'm trying to keep Orienteer tiny.

Implemented in #163


Cmd behaviour

I suggest to adopt the "cmd behaviour" of Google Chrome:

[ ] Cmd + N: New Window
[ ] Cmd + T: New Tab
[ ] Cmd + W: Close Tab (close window if last tab)
[ ] Cmd + Shift + W: Close window

Cmd + W doesn't work.


build(dependencies): 🧱 update crates

Description
Update dependencies and re-run cargo vet:
Updating addr2line v0.21.0 -> v0.22.0 (latest: v0.23.0)
Updating backtrace v0.3.71 -> v0.3.72
Updating gimli v0.28.1 -> v0.29.0 (latest: v0.30.0)
Updating hyper-util v0.1.3 -> v0.1.5
Updating native-tls v0.2.11 -> v0.2.12
Updating object v0.32.2 -> v0.35.0 (latest: v0.36.0)
Updating parking_lot v0.12.2 -> v0.12.3
Updating proc-macro2 v1.0.83 -> v1.0.84
Updating serde v1.0.202 -> v1.0.203
Updating serde_derive v1.0.202 -> v1.0.203
Updating syn v2.0.65 -> v2.0.66
Updating tokio v1.37.0 -> v1.38.0
Updating tokio-macros v2.2.0 -> v2.3.0
Updating winnow v0.6.8 -> v0.6.9

Type of change

[X] Dependency update

How Has This Been Tested?

[X] cargo vet run with all tests passing

Checklist:

[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[X] I have commented my code, particularly in hard-to-understand areas
[X] I have made corresponding changes to the documentation
[X] My changes generate no new warnings
[X] I have added tests that prove my fix is effective or that my feature works
[X] New and existing unit tests pass locally with my changes
[X] Any dependent changes have been merged and published in downstream modules

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 36.58%. Comparing base (55cd785) to head (39ea88d).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #72   +/-   ##
=======================================
  Coverage   36.58%   36.58%
=======================================
  Files           4        4
  Lines        1159     1159
=======================================
  Hits          424      424
  Misses        735      735

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Setting the pointer ring X position is not always correct

From a default constructed ColorPicker, setting the PointerRingPositionXUnits property from code to 0.666 and the PointerRingPositionYUnits to 0 does not always point to the color "Blue". It sometimes gets off a little bit to the left and gives a lighter variant of blue.
Sometimes, this bug occurs:

Normally, this is the expected behavior:

The problem here is, the drawing and color determination relies on the _lastTouchPoint, which is relative to the CanvasSize. However, in some weird situations, CanvasSize can change, invalidating the coordinates of _lastTouchPoint.
See: https://github.com/nor0x/Maui.ColorPicker/blob/ce6fd9bb1813f0c82bb02a25d979c0a19864efe8/Maui.ColorPicker/ColorPicker.xaml.cs#L477-L479

fixed by #8


Use ShadowCopy to load tests

Fixes #170

Looks correct. I only have some minor questions, but please merge :)


Letter distance flawed

Using the default config and yofi 0.1.3 the letter distance when opening yofi is flawed:

Yep, that happens with the fontkit backend and certain fonts. Starting with the 0.1.5 release the default one is fontdue (#63) which should handle font stuff better so you simply need to update yofi.


Release Storage Track 2 Library Preview 4 for JS

*=Work owned by xstore team
Features

[ ] Test HTTPS Proxy Support (required by storage explorer) #3465
[ ] Dev Connection String #3289 #2766 #5004
[ ] Azure.Core support for content type multi-part/mixed #4932
[ ] File download convenience helpers #2603
[ ] Async iterators for list handles #5101

Fit and Finish

[ ] Upload progress callback is incorrect #4719
[ ] Perf #5056
[ ] Bugs #5033
[ ] Azure Identity completeness #5097 #5051
[ ] Docs/Samples #4728 #3954 #4680 #4906 #5098 #5109 #5134

[ ] Readmes #2239 #5080

[ ] Tests #4580 #1930  #4366 #4633 #5112
[ ] Align connection string support with other languages #5081
[ ] Parameter validation #2277
[ ] Packaging broken for Webpack #4890
[ ] Memory leak #4964
[ ] Metadata casing incorrect #4966
[ ] Error handling improvements #4999
[ ] API tweaks #5007 #5062 #5102 #5106
[ ] Import @azure/test-utils-recorder #5152

Nice to have

[ ] Enable VSCode debugging for browser tests #3347
[ ] Update Polyfill for IE #4682
[ ] Tests #4196

[ ] NYC code coverage #2820 #2937
[ ] Source map, stack trace #2792
[ ] Rollup warnings in CI #3993
[ ] Browser test improvements #4163 #4679
[ ] Sample automation #3450

@kurtzeborn @HarshaNalluru @jeremymeng Will you help create the branch for adlsgen2 from feature/storage? Or I can create the branch by myself, just check any naming patterns needed for the new branch. I'll change PR destination to the new branch.

I suggest feature/storage-adlsgen2. Fine ?

I suggest feature/storage-adlsgen2. Fine ?

Looks good.

Closing the Epic.


Add files via upload

I've added my college domain (.org)

@Corrub Thank you for your patience while waiting for a review and processing your request. Pull request merged.


Can I parallel the computation?

If I have multiple observation sequences, then the resample_mode() becomes just dramatically slow. And it seems that it only use one cpu. Is there any way I can parallel the computation? Just like batch processing the data and then update the parameters altogether according to the average behaviour?

I found the way to parallel already.


In the indoor eval code, what is pInit and why is it passed to the model?

When looking at the indoor evaluation/test code, I noticed that in addition to the background and foreground mask, there is an additional "pInit" that's passed to the model. This seems to the X,Y translation of the pertubation. Why is this passed to the model?
If I'm running the eval on my own background + foreground mask (manually created by compositing a random indoor item with a background), what values should pInit take?
Thanks!

pInit is the initial warp parameters of the foreground, so with only the translation components active, it defines the initial composite location. This pInit can take an arbitrary value depending on how you define your identity warp, since the subsequently predicted dp are conditioned on the resulting images, not what the value pInit actually takes.


factor-bundle example is creating empty outputs

I did a clone of the project, npm install in the root and in the examples/factor-bundle dir. When I run grunt in the factor-bundle example, the x.js and y.js in public only contains ''require=". When I run the command 'browserify client/x.js client/y.js -p [ factor-bundle -o public/x.js -o publicy.js ] -o public/common.js' it works fine.  I cannot figure out why it does not work through grunt.  Any help is appreciated.

After updating node/npm, this issue seem to go away.

Ugh - getting the same thing - factor-bundle is somehow being interrupted before it finishes writing the output. Sometimes require= and sometimes a full line ending with an open brace. Works fine with browserify-cli but not with grunt-browserify. Reproduced to have no options. @damcard which version of node did you end up on?


Can't find symbol archive_entry_size

Hello,
I tried using nimarchive on MacOS and FreeBSD, and both failed, seemingly by the same cause:

Undefined symbols for architecture x86_64:
"_archive_entry_size", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_error_string", referenced from:
_check__2XBiY2lvo4SY1GvEF8ydOA in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_read_data_block", referenced from:
_copyData__l1jmLtN06kAjtQZqJXWU1A in @m..@s.nimble@spkgs<EMAIL_ADDRESS>_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_read_free", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_read_new", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_read_next_header", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_read_open_filename", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_read_support_compression_all", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_read_support_format_all", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_write_data_block", referenced frm:
_copyData__l1jmLtN06kAjtQZqJXWU1A in @m..@s.nimble@spkgs<EMAIL_ADDRESS>_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_write_disk_new", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_write_disk_set_options", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_write_disk_set_standard_lookup", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_write_finish_entry", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_write_free", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>"_archive_write_header", referenced from:
_extract__QbNO6N9avoWUYifc29a01B5w in @m..@s.nimble@spkgs<EMAIL_ADDRESS>ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)o
in FreeBSD it is a less verbose:
$HOME/.nimble/pkgs/nimarchive-0.3.6/nimarchive.nim(81, 13) Error: attempting to call undeclared routine: 'archive_entry_size'
If you find a fix I would test it and report back.

nimarchive is tested on OSX - can you share the portion of the output where the library being linked is displayed? Should say # Including library .... Looks like it isn't being linked.
FreeBSD is not tested and I don't have a system to try on either.


Add constants

We have some important field constants (see Jubjub), but no way to reference them from within an Expr. They can be embedded directly into an Expr, but it's better to use names for named things.
But maybe it's more important for expression to stay self-contained. Not sure yet.

About the remark about comparing the characteristic of the field with the number u in Jubjub,hs.
I'm sure you know this, but you can do something like
type P =<PHONE_NUMBER>512619047944774050818596583769055250052763782260365869993858118451352435875175126190479447740508185965837690552500527637822603658699938581184513
type F = GF.Prime P
...
u == GHC.TypeLits.natVal (Proxy:: Proxy P)

I'd been wondering about this anyway because it would be good to check that the big number really is prime.

So more like a built-in.


Made examples compiling and more consistent.

I know it's a nitpick but as I already noticed it, why not to fix it?

Current coverage is 83.25% (diff: 100%)

Merging #70 into master will not change coverage

@@             master        #70   diff @@
==========================================
  Files            13         13
  Lines           400        400
  Methods           0          0
  Messages          0          0
  Branches         57         57
==========================================
  Hits            333        333
  Misses           53         53
  Partials         14         14

Powered by Codecov. Last update 5ce3b8c...a536d5f


Adding Support for Amazon Bedrock LLMs

I would like to use Casibase with LLMs served through Amazon Bedrock's APIs. I'm going to start working on a pull request for that.

@ystoneman any update?


disconnect telnet client feature?

One idea to add is a function to close a telnet client session. For example in an active Telnet session, I would capture a ctrl-D (from a SerialAndTelnet.read()) which would exit the Telnet session, but keep the serial and everything else active. The only way I think you could do this now is by calling end() which kills both the server and client?
so like
void TelnetSpy::disconnectClient() {
    if (client.connected()) {
        client.flush();
        client.stop();
    }
    if (connected && (callbackDisconnect != NULL)) {
        callbackDisconnect();
    }
    connected = false;
}

it would be great! :)

The only way I think you could do this now is by calling end() which kills both the server and client?

You can call SerialAndTelnet.setPort() and this will restart only telnet session.
My application already use HTTP client so telnet session is never ended when telnet client is closed.

Thank you for your hint. Added for version 1.2.


How to make fonts work for outline?

I have created this package that depends on pdf-lib to add outline to an outline-less pdf. The code is in accordance to what is suggested here : 1 , 2  . I use PDFString.of() to add the text to the pdf outline.
I have tried what is mentioned here , but the font does not seem to affect the outline.

Hello @lillallol!
Try using PDFHexString.fromText() instead of PDFString.of(). That should solve your issue. See https://github.com/Hopding/pdf-lib/pull/486#discussion_r460346527.

Hello @lillallol!
Try using PDFHexString.fromText() instead of PDFString.of(). That should solve your issue. See https://github.com/Hopding/pdf-lib/pull/486#discussion_r460346527.


[Storage] Fix #26587: az storage file upload: Add --file-url to support supplying the url instead of share/file name

Related command

Description

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature

This checklist is used to make sure that common guidelines for a pull request are followed.

[ ] The PR title and description has followed the guideline in Submitting Pull Requests.

[ ] I adhere to the Command Guidelines.

[ ] I adhere to the Error Handling Guidelines.

Storage


LDAP not working

I tried different settings in ldap_config.py and also read the django docs and double check the config.
But every time I receive "AUTH_LDAP_USER_SEARCH must be an LDAPSearch instance". Can you check this? Manually running a ldapsearch on command line works fine.
Regards,
Stephan

This is the LDAP module doc.
There is nothing more I can do on my side as it depends on your own conf here. There is no added code to manage ldap connections in Squest.

Ok, thanks. Wired. If I put the ldap config in /Squest/settings/development.py it works

The flag is here in the file.
So if you placed the Boolean at the end of the file the LDAP config hasn't been loaded.


minor correction

@Rishabh04-02 Can you squash your commits into one please.
Something like this

@Akarshit Done, thanks for this suggestion.

Thanks :)


Add chinese document

Thanks for the contribution! this is a read-only mirror. please read the contribution guide.


shallowEqual always return false if add properties to Object.prototype

// copy from src/utils/shallowEqual.js
const hasOwn = Object.prototype.hasOwnProperty

function shallowEqual(a, b) {
  if (a === b) return true

  let countA = 0
  let countB = 0

  for (let key in a) {
    if (hasOwn.call(a, key) && a[key] !== b[key]) return false
    countA++  // should check hasOwn.call(a, key) === true and then countA++ ?
  }

  for (let key in b) {
    if (hasOwn.call(b, key)) countB++
  }

  return countA === countB
}

// my example
Object.prototype.bar = 'bar'

let a = {x: '1'}
let b = {x: '1'}

shallowEqual(a, b) // return false

it's a misunderstanding or there are some reasons for this?

Well first off, you shouldn't be adding to primitives, as that affects the entire system and can have unexpected side effects.
We can probably swap out for fbjs's version instead, since it covers these edge cases and might be a bit faster too.


Support Trivy Enterprise Reports

Trivy Enterprise reports have a different schema, it would be helpful if the vulnerability explorer could parse them as well.
Additional features could be:

show and filter acknowledgements
acknowledgement via aqua api

Where can I find the schema specification?

that is a great question. I am afraid that I have not seen a real spec, but only actual reports. These can be generated by running trivy enterprise. Since this can only be done with a license, we could export one and check it into this repo. We probably need to clear this with aqua first, as I am unsure about the license of the produced report.

Great. So let's go this way. I've also seen no JSON schema definition for version 1 and 2. probably we should open an issue since it would be way better to refer to a published spec. It would also allow us to validate against the schema automatically without custom implementation.


remove module/path args

Remove the path and mod arguments from the Configuration, and source .get methods.  These should not be necessary, and we should be able to rely on the name argument to .get() being either a single key on that config object, or a dot-separated module path to the key.

This may fix a bug with arbitrary values in config sources.
Currently, if a config source contains a key that does not lie on the module source tree, and you try to access it, it will fail to follow the path more than 1 step off of the module tree.
to test, create a Config source with a structure that does not match the module, add it to your config sources list, and try accessing an arbitrary leaf.


Updated AppAdapter.java

Added function to filter displayed apps in AppAdapter.java in order to remove all system apps (as system apps tend to not contain ads).

Looks good!

Thanks!


windows_task start_day format incompatibility in 13.4+

Description
windows_task used to take in the start_day as MM/DD/YYYY before Chef Client 13.4
The documentation still shows start_day is required as 05/30/2017
windows_task starting with Chef Client 13.4 now only succeeds when the date comes in as 30-May-2017
Chef Version
Chef Client 13.4 (Windows)
Platform Version
Windows 2012 R2
Replication Case
Create a windows_task with start_day as MM/DD/YYYY (it will fail with Chef Client 13.4+)
Client Output
     * windows_task[chef-client] action create

       ================================================================================
       Error executing action `create` on resource 'windows_task[chef-client]'
       ================================================================================

       ArgumentError
       -------------
       invalid date

       Resource Declaration:
       ---------------------
       # In C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/my_chef_client/recipes/update_windows.rb

        25: windows_task 'chef-client' do
        26:    run_level :highest
        27:    command "C:/opscode/chef/bin/chef-client"
        28:    user "SYSTEM"
        29:    password nil
        30:    frequency :hourly
        31:    start_time (Time.now + 3600).strftime('%H:%M')
        32:    start_day Time.now.strftime('%m/%d/%Y')
        33: end
        34:

       Compiled Resource:
       ------------------
       # Declared in C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/my_chef_client/recipes/update_windows.rb:25:in `from_file'

       windows_task("chef-client") do
         action :create
         default_guard_interpreter :default
         task_name "chef-client"
         declared_type :windows_task
         cookbook_name "my_chef_client"
         recipe_name "update_windows"
         run_level :highest
         command "C:/opscode/chef/bin/chef-client"
         user "SYSTEM"
         password nil
         frequency :hourly
         start_time "18:46"
         start_day "09/25/2017"
         execution_time_limit "PT72H"
       end

       System Info:
       ------------
       chef_version=13.4.24
       platform=windows
       platform_version=6.3.9600
       ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x64-mingw32]
       program_name=C:/opscode/chef/bin/chef-client
       executable=C:/opscode/chef/bin/chef-client

This is fixed with commit https://github.com/chef/chef/commit/b0d96997b7a1f53824c3cb0905de3e4bc770e534

For me, 13.4.24 worked, see discussion on #6434


task_2

@nikhilva91
Task – 2
Code not available. Check and commit back to GitHub then, raise a new PR mention it in tracker


Quietly ignore interfaces in IndexHtmlDispatcher, avoiding NPE.

Issue #109
Interfaces do not have a superclass and thus a NPE exception was happening.
@reviewbybees @jglick @oleg-nenashev

@oleg-nenashev I might be wrong, but this does not ignore the interface per se but avoids the inspection of the class hierarchy, so my understanding is this should restore the previous behaviour.

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@varyvol It is great if it fixes the issue :) Just misunderstood the PR then. Added the Javadoc enhancement proposal above. If you write a direct unit test for the case, it will be perfect

@oleg-nenashev @jglick comments addressed.

@reviewbybees done

@oleg-nenashev @jglick do you know who might merge this?

@varyvol The merge can be done by several people, @vivek and @kohsuke are the maintainers AFAIK. I pinged them both on Friday regarding the release. We may want to also backport the fix to 2.46.3, but it will require a custom branch of Stapler (to be also decided by the maintainers). The release can be done by @kohsuke only.

I am able to cut releases. Anyway this PR needs no immediate release, much less backport, since it is merely a robustness fix and the plugin bug was already corrected.


add wget no-check-certificate in build.sh

If a machine use git for the first time, the command sh build.sh may throw an error as follows. So, it needs use --no-check-certificate in wget
--2017-08-09 15:49:06--  https://raw.githubusercontent.com/lylei9/boost_1_57_0/master/boost_1_57_0.tar.gz
Resolving raw.githubusercontent.com... <IP_ADDRESS>
Connecting to raw.githubusercontent.com|<IP_ADDRESS>|:443... connected.
ERROR: certificate common name “www.github.com” doesn’t match requested host name “raw.githubusercontent.com”.
To connect to raw.githubusercontent.com insecurely, use ‘--no-check-certificate’.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Fix null context when using dummy_rand with mbedtls_pk_parse_key()

Description
In fuzz_privkey, we switched over to using the dedicated dummy_rand() function, which uses ctr_drbg internally, and thus requires an initialised ctr_drbg_context to be passed in via p_rng when calling mbedtls_pk_parse_key(). Leaving the context as null will cause a null pointer dereference.
Status
READY
Requires Backporting
NO
Migrations
NO
Todos

[ ] Tests

Steps to test or reproduce
Test case from https://oss-fuzz.com/testcase?key=5126567532036096 should run clean. I have managed this locally using docker.

@paul-elliott-arm can you edit the description to briefly justify why this doesn't need backporting?


Implement a decorator that performs jitter on max_age

fixes #56

@rhysyngsun could we create a new release for it common


Add a -Zbuild-std-features flag

This flag is intended to pair with -Zbuild-std as necessary to
configure the features that libstd is built with. This is highly
unlikely to ever be stabilized in any form (unlike -Zbuild-std which
we'd like to stabilize at some point), but can be useful for
experimenting with the standard library. For example today it can be
used to test changes to binary size by disabling backtraces.
My intention is that we won't need a --no-default-features equivalent
for libstd, where after rust-lang/rust#74377 is merged we can
unconditionally specify default features are disabled but the default
set of features lists default. That way if users want to override the
list and include the default feature, they can just be sure to include
default.

:umbrella: The latest upstream changes (presumably #8491) made this pull request unmergeable. Please resolve the merge conflicts.

Ok I've updated where we now pass the equivalent of --no-default-features --features default when building libstd, so if you overwrite the list of features to build libstd with you'll need to manually include default.

Nice!  I won't have to comment out backtrace when doing some of my tests now. 😄
@bors r+

:pushpin: Commit 1faf5b9f00c5f2b660c0e305e3d51167990d6761 has been approved by ehuss

:hourglass: Testing commit 1faf5b9f00c5f2b660c0e305e3d51167990d6761 with merge 0a9f2efd7f0cdbc70c948792a87a4740672f0a43...

:sunny: Test successful - checks-actions
Approved by: ehuss
Pushing 0a9f2efd7f0cdbc70c948792a87a4740672f0a43 to master...


I keep getting orator.exceptions.query.QueryException

I have started using your awesome ORM on production and I get this error like once everyday which causes that endpoint to return a 502 until I refresh it like several times. Here is the stack-trace:
Traceback (most recent call last):
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./theapp/controllers.py", line 28, in restaurants
    ress = Restaurant.with_('area', 'foods').get().to_dict()
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/orator/orm/builder.py", line 198, in get
    models = self.get_models(columns)
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/orator/orm/builder.py", line 439, in get_models
    results = self.apply_scopes().get_query().get(columns)
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/orator/query/builder.py", line 1049, in get
    return self.get_fresh(columns)
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/orator/query/builder.py", line 1067, in get_fresh
    return self._processor.process_select(self, self._run_select())
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/orator/query/builder.py", line 1079, in _run_select
    not self._use_write_connection
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/orator/connections/connection.py", line 34, in _run
    e, query, bindings, wrapped
  File "/var/www/grub_flask/venv/local/lib/python2.7/site-packages/orator/connections/connection.py", line 318, in _try_again_if_caused_by_lost_connection
    raise QueryException(query, bindings, e)
orator.exceptions.query.QueryException: (0, '') (SQL: SELECT * FROM `restaurants` ([]))
[pid: 13958|app: 0|req: 185/967] <IP_ADDRESS> () {46 vars in 989 bytes} [Mon Mar 21 18:08:02 2016] GET /api/v1/restaurants/ => generated 0 bytes in 4 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)

Here is what my query looks like:
Restaurant.with_('area', 'foods').get().to_dict()

Pls note that I use orator with flask and I don't use the flask-orator package, rather I connect to it directly from my model file

I will look into it

Please I need a fast solution to this.
I have to always restart the flask application process whenever I encounter this.

I am unable to reproduce the error.
Which database package are you using (PyMysql, mysqclient, psycopg2)?
Also, are you using the 0.8 version of orator or the develop branch?
Finally, which Flask version are you using?

Flask (0.10.1)
Orator - develop branch
I tested with both MySQLdb and pymsql (wc are d 2 supported drivers as seen in the code -- orator/connectors/mysql_connector:3) and got the same errors

please i really need your help on this issue as I've already gone far with this application n would be difficult switching my stack at this time.

I think I have found a temporary fix,
I had to comment out  the self._db.disconnect() in the flask_orator/init.py file

Thanks for narrowing down the issue :clap:
I just pushed a fix on the develop branch so you should be able to uncomment the line in flask-orator.

Thanks alot, will update n feed u back

The connection is stable now. I think this issue can be closed now. Thanks alot


New implementation for Conflicts-With Scrutinizer

Part of #2354

@wetneb: I hope this is what you were trying to explain about the new constructor implementation?
Stuck with getStatementByType implementation in MockContraintFetcher but trying to make it work ASAP.

That's exactly it, you nailed it!
For MockConstraintFetcher, one way to do it would be to just return one big list containing all sorts of constraint declarations - that would have the same sort of effect as all the other methods. But as we discussed in the call, I think the proper solution for this is to remove this class and switch to proper mocking with Mockito in each test class.

For the LGTM issues: you should change things like @param pid: to @param pid (no colon at the end).


ZipperBams tags to reverse

Description of the bug
Hi,
I wanted to ask why tags-to-reverse and tag-to-revcomp is set to Consensus in zipperbams after both uncollapsed and collapsed alignment.
In the best practices, this these arguments are only used for the collapsed alignment.
But here both ALIGN_RAW_BAM and ALIGN_CONSENSUS_BAM use tags-to-reverse and tag-to-revcomp set to consensus (as both come from the ALIGN_BAM module).
Will this impact the pipeline at all if you set tags-to-reverse as consensus when you use zipperbams after the uncollapsed alignment? Do you recommend having this argument for zipperbams after uncollapsed alignment or does it not matter either way?
Thank you!
Command used and terminal output
No response
Relevant files
No response
System information
No response

It shouldn't matter for the raw reads as those tags don't exist, but yes, we could optimize it so those options aren't set for the raw reads.

It's a no-op for raw reads, so keeping it in for now.


Fix pom to use pinot-common-jdk8 for pinot-connector jkd8 java client

This PR fixes the pinot-common module added as part of PR https://github.com/apache/pinot/pull/9351 to use pinot-common-jdk8 instead of pinot-common.
cc @xiangfu0 @siddharthteotia

Thanks for your quick turnaround!

@xiangfu0
Sorry I forgot to mention I'm still building this locally. I've run into this issue:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project pinot-java-client-jdk8: Could not resolve dependencies for project org.apache.pinot:pinot-java-client-jdk8:jar:0.12.0-SNAPSHOT: Could not find artifact org.apache.pinot:pinot-common-jkd8:jar:0.12.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :pinot-java-client-jdk8


FW-4121 Permissions with tests and sample API

These changes add Django Rules based permissions. The set of changes includes base and view predicates, as well as some utilities. Additionally, there is a large set of unit tests for the permissions.
The complete set of tests can be executed using the command pytest from the root project directory. Currently, there are 290 total tests, which include tests for the Users app and tests for the permissions in this PR.
Along with the permissions, there is an example API view for the site model, which uses the permissions as defined in the site model meta classes rules_permissions field.
Note that the permissions for staff and super admin roles are not fully implemented in these changes and will be completed in a separate ticket.

Great work. Doing some more testing locally but looks good to me.


halt with 0 on successful run

This would be nice just so someone can run rebar3 like the script I suggested before, erl ... -run rebar3 main "$@"