Hazard pointers

Epoch-based memory reclamation is great, but it is not the right solution for all situations that require deferred memory reclamation in concurrent settings. We will probably need to implement hazard pointers to accommodate the rest.
Here are some of my thoughts on this matter. I don't have any concrete proposals yet - just want to lay everything out so we can share our notes and think this through. If you have any ideas, concerns, interesting use-cases for hazard pointers, or any other comments, please say so. :)
I'm particularly interested in hearing more about @jeehoonkang's wait-free queue. He has already prototyped garbage collection based on a combination of epochs and hazard pointers, so check that out.
Epoch-based reclamation vs hazard pointers
The fundamental difference between epoch-based reclamation (EBR) and hazard pointers (HP) is in how coarse or fine-grained object protection is. With EBR, we declare critical sections by pinning and saying "in this critical section, we might potentially access any object". With HP, however, each hazard pointer protects only a single object at a time. So even if we're accessing just one object for a long time, that will not prevent reclamation of other objects.
EBR has a (mostly theoretical?) danger of accumulating unbounded number of dead unreclaimed objects. E.g. this might happen if a pinned thread gets preempted by the OS for a very long time.  On the other hand, with HP we usually have a bounded number of hazard pointers so only a bounded number of dead objects can be be kept unreclaimed.
Pinning a thread and protecting an object with a hazard pointer should be operations with comparable performance costs. They both perform a few atomic loads, atomic stores into thread-locals, and a full fence.
Traversing a linked data structure is almost certainly faster using EBR. For example, if we want to search for a particular node in a skiplist or binary search tree, we'll have to start from the root and make several steps through the data structures to find the node. EBR would incur a fixed cost at the beginning and at the end of the procedure, but HP would come with a performance penalty at each step of traversal.
The main advantage of HP is that hazard pointers can be kept alive for a very long time without worry of blocking memory reclamation globally. With EBR, we must make sure that threads are pinned only for very short periods of time. There is another advantage of HP - it supports eager memory reclamation, as will be demonstrated in the following section.
Eager garbage collection using HP
In crossbeam-deque, we have two structs: Deque (owned by a single thread) and Stealer (shared among multiple threads). A Chase-Lev deque contains a buffer that gets atomically replaced with a larger one when it gets full or a smaller one when its capacity is underused. But note that only operations on Deque (a single thread) can modify the pointer to the buffer.
The buffer is only occasionally replaced, and when it is, we want to destroy the old one as soon as possible (because it might be pretty large). Currently, we call guard.flush() just after replacing the buffer so that it gets moved into the global garbage queue immediately. We also periodically call collect() on every Nth call to epoch::pin() so that garbage collection is triggerred often enough. This is a hacky solution. We can do better.
Suppose that we used HP instead. The cost of pinning and protecting the buffer by a hazard pointer should be comparable because we don't traverse the data structure. In each operation, we only do a single load to acquire the buffer, that's it.
In order to defer destruction of an old buffer, instead of calling guard.defer(...) let's call
retire(old_buffer), which is implemented as:
fn retire(old: *mut Buffer<T>) {
    for haz in hazard::iter_all_hazard_pointers() {
        loop {
            // Is there sombeody still using the old buffer?
            if haz.load(Relaxed) == old {
                // Yes. Let's try setting this hazard pointer to null.
                if haz.compare_and_swap(old, ptr::null(), Relaxed) {
                    // Success! When the owner of `haz` stops using it, they will notice that `haz`
                    // is set to null and will take over the responsibility of retiring the old
                    // buffer. Then that thread will call `retire(old)` to try destroying the
                    // buffer again.
                    return;
                }
            }
        }
    }

    // Nobody is using the old buffer. We may destroy it immediately.
    unsafe { drop(Box::from_raw(old)); }
}

Note that this strategy makes destruction fully eager: the old buffer gets destroyed as soon as all threads stop using it, without any further delay. In fact, eager destruction with hazard pointers is not much different from eager destruction with Rc or Arc.
Long-lived pointers
Iterators over concurrent data structures don't work well with EBR because they can be long-lived,
while pinning must be very quick. In other words, EBR forces us to keep loaded pointers for very
short periods of time.
This is a problem for data structures like wait-free queues and skiplists. Hazard pointers are a very natural solution for long-lived pointers.
Here is an example of how we might iterate over a linked list using HP:
struct Node<T> {
    data: ManuallyDrop<T>,
    next: Atomic<Node<T>>,
}

struct List<T> {
    head: Atomic<Node<T>>,
}

impl<T> List<T> {
    fn count(&self) -> usize {
        // Register two new shields (in a way, they are similar to `epoch::Shared<T>`).
        let mut a = hazard::shield();
        let mut b = hazard::shield();

        let mut count = 0;

        self.head.load(SeqCst, &mut a);

        while !a.is_null() {
            // Load the next pointer into `b` and set `a` to null.
            a.unwrap().next.load(SeqCst, &mut b);
            a.release();

            // Swap `a` and `b` and continue iterating.
            mem::swap(&mut a, &mut b);
            count += 1;
        }

        count

        // `a` and `b` are dropped and get unregistered.
    }
}

Writing the same code using EBR would require us to pin the current thread for the entire duration of count, which might take an unacceptably long time for one pinning. Repinning during iteration (guard.repin()) is not possible because we can't let go of the pointer to the current node.
Hybrid GC: using both EBR and HP at the same time
Suppose we want to add a new operation called pop_head() to List<T>, but use EBR instead of HP. We might implement it as:
impl<T> List<T> {
    fn pop_head(&self) -> Option<T> {
        let guard = &epoch::pin();

        loop {
            let head = self.head.load(SeqCst, guard);
            if head.is_null() {
                return None;
            }

            let next = unsafe { head.deref().next.load(SeqCst, guard) };

            if self.head.compare_and_set(head, next, SeqCst, guard) {
                unsafe {
                    let data = ptr::read(&head.deref().data);

                    guard.defer(move || {
                        // Once EBR decides that `head` is unreachable, we must also make sure that
                        // there are no outstanding hazard pointers to it. We pass the garbage
                        // along to the HP-based GC.
                        //
                        // The first argument to `defer` is the actual pointer, and the second
                        // argument is the destructor.
                        hazard::defer(data.as_raw(), move || {
                            data.into_owned();
                        });
                    });

                    return Some(data);
                }
            }
        }
    }
}

Note that this way a dead object first goes through the epoch-based GC and then through the HP-based GC, where it is finally destroyed.
An interesting challenge with mixing EBR and HP is how to make APIs from crossbeam-epoch and crossbeam-hazard work well together. For example, how are we going to load a crossbeam_epoch::Atomic<T> into a crossbeam_hazard::Shield<T>? Is it going to be atomic.load(SeqCst, &shield)? Or maybe shield.protect(a.load(SeqCst, epoch::unprotected()))? I don't know...
Shield registration
A Shield<T> is a slot that holds a hazard pointer, shielding an object from destruction. (I'm actually using terms shield and hazard pointers interchangeably.) Each shield typically belongs to a specific thread (although it is always readable by all threads). In order to create a shield, we have to register it in some kind of global list so that other threads are aware of all currently existing shields.
We should allow registration of arbitrary number of shields. However, it must be noted that having a lot of registered shields will slow down garbage collection.
Sometimes it makes sense to cache registered shields in TLS to avoid the cost of shield registration on every operation. For example:
thread_local! {
    static A: Shield<u8> = hazard::shield();
    static B: Shield<u8> = hazard::shield();
}

impl<T> List<T> {
    fn count(&self) -> usize {
        A.with(|a| {
            B.with(|b| {
                // Ugly hack, but oh well.
                let a: &Shield<T> = unsafe { mem::transmute(a) };
                let b: &Shield<T> = unsafe { mem::transmute(b) };

                // ...
            })
        })
    }
}

That is some really ugly code, but you get the idea. :)
Previous work
Finally, it's worth looking into existing implementations of HP-based garbage collection. Here are a few examples I'm aware of:

conc: http://ticki.github.io/blog/fearless-concurrency-with-hazard-pointers/
libcds: https://kukuruku.co/post/lock-free-data-structures-the-inside-memory-management-schemes/

Interesting! Especially the parts about mixing HP and EBR. I'm not too sure about the shield API as presented here, but this is certainly something we can play around with. I'd imagined a Ptr like struct, which registers and deregisters itself, or something. For what its worth, I've implemented a working version of HP in my semester project over here, although the code base is dubious at best (so don't judge! 😇).
Is something missing or misplaced in the code under "Eager garbage collection using HP"? That loop seems very ... loopy 😄
Also, I'm curious about where the "shield" name comes from (maybe this is a question for @jeehoonkang)?

I'm not too sure about the shield API as presented here, but this is certainly something we can play around with.

All the code I've written above is just heavy handwaving - definitely not an API we should settle with. :)

For what its worth, I've implemented a working version of HP in my semester project over here, although the code base is dubious at best (so don't judge! 😇).

Oh, nice! I'll take a look at the code and add it to the Previous work section.

Is something missing or misplaced in the code under "Eager garbage collection using HP"? That loop seems very ... loopy 😄

Oops, you're right! I've fixed the code now.

Also, I'm curious about where the "shield" name comes from

It's from the Project Snowflake paper. Shield should be equivalent to HazardPtr in comere, AFAICT.

Why not use QBSR instead in combination to say that you are finished with the objects for now?

You can simulate QSBR with Guard::repin. See https://github.com/crossbeam-rs/rfcs/issues/18 for a discussion on this topic.

but the big problem with hazard pointers is that the memory used is potentially unbounded.

Sorry, I'm confused - did you perhaps mean QSBR or EBR instead of hazard pointers?
With hazard pointers, the amount of garbage can be made bounded. That's one of the main advantages of hazard pointers.

Just to get an idea of the state of things (as its been awhile). Is this something that is still actively considered as an addition to crossbeam ?


Please share your dataset, and make an entry on mylo's repo

Greetings,
Mylo, the author of the quantizer repo (https://github.com/gitmylo/bark-voice-cloning-HuBERT-quantizer/) is also collecting the datasets for the multiple languages people trained Bark's Hubert quantizers, as you can see here:
https://github.com/gitmylo/Voice-cloning-quantizers/
Can you please make a Pull Request in this repo and add the chinese model and dataset you trained on?
This is very important, as there are plans that we could merge all datasets in the future and train a single multi-language voice cloning model, where, for example with chinese, we could use the multilanguage tokenizer to make an english voice speak chinese and vice-versa, or make a spanish voice speak chinese etc.

Hi, thanks for your interest. The voice cloning for Chinese speech in this repo is not based on Bark's Hubert quantizers. It's based on SambertHifigan developed by Alibaba. I know Mylo's work, which greatly improved the quality of Bark voice cloning. If you have any ideas on training Mylo's model on Chinese datasets, feel free to contact me.

Does that model have the dataset it was trained on available?
Is that model similar to either Wav2Vec or Hubert? Can the weights be merged?

Since Bark's native TTS capabilities for Chinese is bad, indeed trying the approach from Mylo's repo directly is a wasted effort.
Does your solution improve Chinese TTS overall for Bark? And I don't mean the voice cloning itself, I mean producing more accurate audio outputs.
If so,  there is something that can be tried, @KevinWang676 : do you think if one creates a custom script on the prepare step from Mylo's repo using your solution for Chinese TTS, particularly the "create_wavs" step, would we be able to train a Chinese Hubert quantizer? Since the wav outputs would be more accurate, I believe we could get better results.

Does your solution improve Chinese TTS overall for Bark?
Yes, the new solution is more stable and sounds more native.

do you think if one creates a custom script on the prepare step from Mylo's repo using your solution for Chinese TTS
Maybe yes, I think it's just a Chinese TTS process.

would we be able to train a Chinese Hubert quantizer
However, Bark's native TTS capabilities for Chinese is bad, so we still don't want to use Bark even if we get a Chinese Hubert quantizer. Is there any other way to get around Bark? Thanks.


parAlmond:  Add Alan's "LPSCN" AMG aggregation algorithm.

The code in formAggregatesLPSCN() is due to Alan N.G.H.  We add new options "PARALMOND AGGREGATION STRATEGY" and "PARALMOND LPSCN ORDERING" to allow the user to switch between the default strategy and LPSCN and to set the node ordering used in LPSCN.
Two items that might need addressing before this is merged:

We've adjusted setupQuad3D.rc for the elliptic solver, but other setup files will need adjusting as well.

The new code calls exit() if an invalid value is passed for these options.  This is not a great way to handle errors in library code.

I've added the option to use the un-sorted list of aggregates rather than throw an error if the sort type option is missing. Without sorting, this algorithm is very similar to the default greedy algorithm used in classical smoothed-aggregation methods.
@aaustin141 can you make one more commit which adds the new paralmond options to the rest of the setup files in libparanumal?

That should do it---I added the options to every setup file that sets the other PARALMOND options.

Approved. Thanks @aaustin141 and @alanngh !

Thank you for taking the time to look at this @noelchalmers!


Create cmake-multi-platform.yml

 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.

Thanks for the contribution @Romario242003!
Can you provide some context for this addition? What problem is it solving and what motivated its inclusion.


Aligned the badges to centre

Let me know if the "Sushiksha-website" has to come at the centre or at the same position

[ ] Center align all the badges

[ ] Create Table of Contents

[ ] Write about Sushiksha

[ ] Update the license part in Readme.md
https://github.com/18praneeth/sushiksha-website#license

[ ]  Center align all the badges
[ ]  Create Table of Contents
[ ]  Write about Sushiksha
[ ]  Update the license part in Readme.md
https://github.com/18praneeth/sushiksha-website#license

Please refer to this task list

[ ]   Center align all the badges
[ ]   Create Table of Contents
[ ]   Write about Sushiksha
[ ]   Update the license part in Readme.md
https://github.com/18praneeth/sushiksha-website#license

Please refer to this task list

Where to add the table of contents ?

[ ]    Center align all the badges
[ ]    Create Table of Contents
[ ]    Write about Sushiksha
[ ]    Update the license part in Readme.md
https://github.com/18praneeth/sushiksha-website#license

Please refer to this task list

Where to add the table of contents ?

After the Introduction of Sushiksha you can have table of contents like

Development
Installation

@krishnashenoy123 Link this License file
https://github.com/18praneeth/sushiksha-website/blob/master/LICENSE

https://github.com/18praneeth/sushiksha-website#license

[ ]     Center align all the badges
[ ]     Create Table of Contents
[ ]     Write about Sushiksha
[ ]     Update the license part in Readme.md
https://github.com/18praneeth/sushiksha-website#license

Please refer to this task list

Where to add the table of contents ?

After the Introduction of Sushiksha you can have table of contents like

Development
Installation

I added the Installation, Contributing and License, What should i do for the Development ? should i add it ? i didnt it anywhere in thee readme file.


feat: added governance page ui and proposal details ui

Dependencies added
react-gauge-component

DescriptionGauge component for React
AuthorAntônio Lago
LicenseMIT


Add geedim to python packages

Hi.  Please consider adding geedim to your list of python packages.  It is a CLI and API for searching, compositing and downloading EE imagery.

geedim is very interesting. Is it possible to expand it for downloading any Earth Engine imagery, not just Landsat and Sentinel-2? It will be great to integrate it into geemap.

Thank you.  It should download any EE imagery as it is.  The geedim.download.BaseImage class implements the tiled download - you might be able to integrate that into geemap...

That's great to know. I will look into it. https://github.com/giswqs/geemap/issues/1110


Broken link (How to File an Issue)

This is a Bug Report

Problem:
"How to file an issue" on the Community page (https://github.com/kubernetes/community/) points to a dead label/page.
Proposed Solution:
Reset the link on the Community page to a useful page.
(Either https://github.com/kubernetes/community/blob/master/contributors/guide/first-contribution.md#file-an-issue or the Triage page at https://github.com/kubernetes/community/blob/master/contributors/guide/issue-triage.md)
Page to Update:
https://github.com/kubernetes/community/

done.
/close


Question about model prediction results

Thank you very for your work. I normalized the data in the preprocessing stage and denormalized the model prediction results to get the real prediction situation. I trained for a certain number of epochs(500), but I still cannot eliminate the grid lines that appear in the model prediction results, as shown in the picture below. I wonder if you have any relevant experience.

I appreciate your attention and assistance.

@jacobbieker was this something to do with the loss function used? I've definitely seen this before


Autoselect class in completion matches wrong class

import flash.display.Sprite;
var foo:Sprite;
foo = new <starling.display.Sprite is selected>

http://www.flashdevelop.org/community/viewtopic.php?f=6&t=11769

i checked in last release, aill works ok, may be should close this issue?

@elsassph ?


Disallow Vector{Union{String, Symbol}} to have both types in a single vector

This signature is used in many getindex() functions. There are two options to solve this:

Create separate functions to handle Symbol and String types respectively.
Throw an error if both types are present in the input argument. This is what DataFrames.jl does.

* Throw an error if both types are present in the input argument. This is what DataFrames.jl does.

My preference is with this because it will be easier to maintain by having less number of functions which behave exactly same except for the argument type. Plus, DataFrames.jl also follows the same approach so it is better to be consistent.


CIF-1022 - Improvements for Product Teaser component

improve styling similar to content teaser component
reduce default size of the component

Verified with fresh Venia sample store and current branch.


Other Endpoints marked duplicate when Admin UI is mapped last.

When configuring the endpoint in the Startup.cs file, any endpoints that come before MapDbLocalizationAdminUI are re-configured and marked as ambiguous duplication. The quick fix is to move the MapDbLocalizationAdminUI as the first endpoint in the list. Not sure if this can be fixed, or just needs to be more clear in the documentation
Example code of /TestError being inaccessible due to duplicate ambiguous routes.
app.UseEndpoints(endpoints =>
{
  endpoints.MapControllerRoute("TestError", "/TestError", new { controller = "Debug", action = "TestError" });
  endpoints.MapContent();
  endpoints.MapRazorPages();
  endpoints.MapDbLocalizationAdminUI();
});

https://github.com/valdisiljuconoks/localization-provider-epi/issues/174


Added config option 'diagnostic_prefix_format' and fix show_header=false scenario

Need to suppress a line when there is no header. Also give ability to customise prefix for diagnostic messages.

Thanks @smhc


Auto scan for photos

Any chance to implement some kind of watcher that will watch for changes and start scanning for photos? Or just a script that can be executed in cron. Would be really nice feature.

I just found out that you actually can get a bear token:
/api/auth/token/obtain/
... and then launch scan workers:
curl -H 'Accept: application/json' -H "Authorization: Bearer $YOURTOKEN" $YOURURL/api/scanphotos

I just found out that you actually can get a bear token:
/api/auth/token/obtain/
... and then launch scan workers:
curl -H 'Accept: application/json' -H "Authorization: Bearer $YOURTOKEN" $YOURURL/api/scanphotos

I wrote a small script to do it with cron.
#!/bin/bash
TOKEN=`curl -s -d "username=USERNAME&password=PASSWD" -X POST http://YOUR--URL/api/auth/token/obtain/ | jq '.access' | tr -d '"'`

curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://YOUR--URL/api/scanphotos

I wrote a small script to do it with cron.
#!/bin/bash
TOKEN=`curl -s -d "username=USERNAME&password=PASSWD" -X POST http://YOUR--URL/api/auth/token/obtain/ | jq '.access' | tr -d '"'`

curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://YOUR--URL/api/scanphotos

Great, thanks for advice

Great, thanks for advice

#204 Allow to create an other process in parallel of the backend process.

@tomamplius So, how I can do this when PR is already merged?

Add this to you .env file:
Number of workers, when scanning pictures. This setting can dramatically affect the ram usage.
Each worker needs 800MB of RAM. Change at your own will. Default is 1.
HEAVYWEIGHT_PROCESS=1

on docker in don't know if cron is install
after add on /etc/cron.d/librephotos-scan
with bellow content
0 0 * * * root cd /code && python3 manage.py scan

It will be scan at 00:00
# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,>
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed

For docker it will be
sudo docker exec --user root CONTAINER_NAME python3 manage.py scan
but after a while it reports error:
System check identified some issues:

WARNINGS:
api.Face.person_label_is_inferred: (fields.W903) NullBooleanField is deprecated. Support for it (except in historical migrations) will be removed in Django 4.0.
        HINT: Use BooleanField(null=True) instead.

Good. Now it's working fine
@derneuere  maybe you should add to readme or somewhere information about how to exec auto scan?
sudo docker exec --user root CONTAINER_NAME python3 manage.py scan

example cron
0 3 * * * sudo docker exec --user root CONTAINER_NAME python3 manage.py scan >/dev/null 2>&1

Thanks for implementation!

What about periodic scan of nextcloud folder? is there a way to implement it?

PR  #246 allow use the same command to scan local folder or nextcloud photos

For docker it will be sudo docker exec --user root CONTAINER_NAME python3 manage.py scan after a while it reports warning:
System check identified some issues:

WARNINGS:
api.Face.person_label_is_inferred: (fields.W903) NullBooleanField is deprecated. Support for it (except in historical migrations) will be removed in Django 4.0.
        HINT: Use BooleanField(null=True) instead.

Also, in admin area it seems that scan start just for one user, rest is ignored

直接运行docker exec --user root CONTAINER_NAME python3 manage.py scan会提示错误，查了发现是环境变量SECRET_KEY没有设置，不知道是不是我设置错误。
后来写了一个powershell脚本，成功运行了
$secret_key=(docker exec CONTAINER_NAME bash -c "python3 manage.py shell -c $'from django.core.management.utils import get_random_secret_key\nprint(get_random_secret_key())'") docker exec CONTAINER_NAME bash -c "export SECRET_KEY='$secret_key' && python3 manage.py scan && export SECRET_KEY=''"

@dashixdot It should just work. This sounds like a new error. I created an issue for it: #550

I think that if scan API could take a argument specifying which subdirectory to scan. So that people can combine this API with some filesystem changing monitor to do autoscan.A full scan takes a lot time.


Step Based BPM-Changes

What feature do you want to get added on the base engine?
It's really annoying to have BPM changes be section based since it's really limiting, plus it straight up makes BPM changes that are mid-section completely impossible to do, that or you have to do some really annoying beats per section fuckery, which is not always ideal or even solves the issue
To test your sight, and reliability, please select the option of what should NOT be requested.
Stage Editor, 6K+ support, and winning icons.

next think you know they're gonna want decimal step based bpm changes

next thing you know they're gonna want decimal step based bpm changes

I dunno why that's ur response because BPM changes being section based is a royal pain in the ass, also i think the way BPM changes work is among the reasons why Monster is only a debug song

Would require another rewrite on the BPM Changes system, i'm not willing to do it and won't accept PRs about it aswell.
You can pretty much already do this through reducing the amount of steps per section

Would require another rewrite on the BPM Changes system, i'm not willing to do it and won't accept PRs about it aswell. You can pretty much already do this through reducing the amount of steps per section

I'd agree but the beats per section system can be a little limiting on that front, i guess if you really didn't want it to be step based you could increase or even just take the cap off of how many beats per section one can use since it's limited to 6


Why you need a PIN screen doesn't have an always shown Continue button on Android

Description of problem
On Android the Continue button is not visible all the time as it is on iOS. You Have to scroll down to press Continue. I assume this should be like iOS. See Screen Shot
Expected behavior
Continue Button is always visible at the bottom of the screen.
Steps to reproduce
Screenshots and/or log output

Environment

[X] Occurs on Android
[ ] Occurs on iOS

Build #:
2084
Android Device Model:
iOS Device Model:
Workaround
Severity

[ ] High
[ ] Medium
[X] Low

Verified fixed (IOS / Android).


doc: set DT Kit to 1.0.0

Description
This PR includes the last fixes after qg4-review. It bumps the version to 1.0.0, reflecting the conditional approval of release management.

@LuisRickert - with the release, the kit should also be moved to the "versioned-docs" folder, right? Is there any documentation how to do this, especially since there's no versioned sidebar for R3.2 yet?

@LuisRickert - with the release, the kit should also be moved to the "versioned-docs" folder, right? Is there any documentation how to do this, especially since there's no versioned sidebar for R3.2 yet?

yes and no, with every Release the maintainer of the Tractus-X run a script that does this for you. You commit your changes to your fork and merge them via a pull request into the "docs" folder. The "versioned-docs" directory shall not be modified by others than the Tractus-X Maintainer.

@SebastianBezold
Please review if all considerations from QG4 review have been addressed. Thanks!

Changes look good to me. 👍
The only thing that got my attention is the spaces in the KIT directory names. The link with html encoded spaces you had to use is hard to read and hard to maintain, ones things are moved. But this is something we should consider as issue and separate PR, since it would affect all KITs and already existing links

Ready for merge


Add contactpoint resource

Any feedback is highly appreciated! Used #1420 as a refrence to create this.
closes #1455

Thanks for the contribution! Works well and the overall code quality looks good
I have some concerns around UID handling. The current approach does not allow for renaming of resources, as the UID is retrieved by matching the name.
IMHO a better approach would be to use the Kubernetes UID (part of the object metadata). This way we don't have to do any name matching in the operator and have a consistent UID. We do something similar in the folder resource.

I agree with you, will change it to use the K8s UID

Thanks @theSuess , I just removed the whitespace so hopefully passes that last test now


[Feature] Add enabled state to dialog buttons

We're facing a use-case where we want to show a dialog to the user with a timeout on an OK button to force the user to pay attention. Right now, the InfoDialog has no way of setting a button as "disabled". This could be achieved, in its simplest form, by allowing to configure the color of the button text for SelectionButtons, or as a better solution, by allowing to set a property such as enabled: Boolean on a dialog button to set whether it's clickable or not.

After realizing that all the Selection classes and remember functions need to be fixed for the buttons to recompose correctly, considering the enabled state inside the selection button overrides the internal button enabled state based on the use-case validity, I decided to pause. I suggest exploring alternative approaches to draw extra attention to the positive button. Have you considered experimenting with button styles? For example, using a text button for the cancel option and a filled button for the positive action.

Alright, I respect your decision here. Yes for now we agreed to use a different UX for this usecase. Dialogs with timeouts aren't a perfect solution for the problem we faced anyway. However, would you be willing to merge a PR that implements the functionality if I come around to implementing it?


redirecting: Why performance matters

I've updated: https://web.dev/why-speed-matters/
With content from: https://developers.google.com/web/fundamentals/performance/why-performance-matters
Issue: https://github.com/GoogleChrome/web.dev/issues/3544
This PR:
deletes the article and related images
deletes the translations
adds a redirect to the new content on web.dev
marks the page as external in the toc
CC: @petele

Whoops!
There were 13 warnings that will prevent this PR from being merged. Please take a look, and either fix, or provide a justification for why they can't be fixed.
WARNINGS
src/content/en/fundamentals/performance/why-performance-matters/index.md - Unable to read file, was it deleted?
src/content/id/fundamentals/performance/why-performance-matters/index.md - Unable to read file, was it deleted?
src/content/ja/fundamentals/performance/why-performance-matters/index.md - Unable to read file, was it deleted?
src/content/ko/fundamentals/performance/why-performance-matters/index.md - Unable to read file, was it deleted?
src/content/pt-br/fundamentals/performance/why-performance-matters/index.md - Unable to read file, was it deleted?
src/content/zh-cn/fundamentals/performance/why-performance-matters/index.md - Unable to read file, was it deleted?
src/content/en/fundamentals/performance/why-performance-matters/images/impact-calculator-1x.png - Unable to read file stats: ENOENT: no such file or directory, stat 'src/content/en/fundamentals/performance/why-performance-matters/images/impact-calculator-1x.png'
src/content/en/fundamentals/performance/why-performance-matters/images/impact-calculator-2x.png - Unable to read file stats: ENOENT: no such file or directory, stat 'src/content/en/fundamentals/performance/why-performance-matters/images/impact-calculator-2x.png'
src/content/en/fundamentals/performance/why-performance-matters/images/lighthouse-1x.png - Unable to read file stats: ENOENT: no such file or directory, stat 'src/content/en/fundamentals/performance/why-performance-matters/images/lighthouse-1x.png'
src/content/en/fundamentals/performance/why-performance-matters/images/lighthouse-2x.png - Unable to read file stats: ENOENT: no such file or directory, stat 'src/content/en/fundamentals/performance/why-performance-matters/images/lighthouse-2x.png'
src/content/en/fundamentals/performance/why-performance-matters/images/speed-comparison.png - Unable to read file stats: ENOENT: no such file or directory, stat 'src/content/en/fundamentals/performance/why-performance-matters/images/speed-comparison.png'
src/content/en/fundamentals/performance/why-performance-matters/images/speed-scorecard-1x.png - Unable to read file stats: ENOENT: no such file or directory, stat 'src/content/en/fundamentals/performance/why-performance-matters/images/speed-scorecard-1x.png'
src/content/en/fundamentals/performance/why-performance-matters/images/speed-scorecard-2x.png - Unable to read file stats: ENOENT: no such file or directory, stat 'src/content/en/fundamentals/performance/why-performance-matters/images/speed-scorecard-2x.png'


If server is stopping for X amount of time, kill it.

If a Minecraft server stalls and the panel tries to restart it, it gets stuck "stopping".
Multicraft has a nice feature where if a server is stopping for too long, it will kill it and start it up again, would love to see this in Pterodactyl.

Having switched off of Multicraft to Pterodactyl this is definitely a feature that would I love having available.

Could be added as a config option on services as different game servers need different amounts of time to shut down.

Implemented in the new wings daemon. :)


needs a github actions setup that actually works

cc @jkachmar

Free labor for Justin

think of it as a labor of love


RadioButtons does not select first item when tabbing into a group that has no checked items set

Describe the bug
When using the RadioButtons container control with some items set inside it, but no SelectedIndex has been set and I tab into the group keyboard correctly puts focus on the first item but does not select it. This in turn causes the narrator to not read out the full n of N as it should.
Once I navigate within the list, selection is set with focus and everything's good.
Steps to reproduce the bug

Create a blank app and set up a RadioButtons group control with no specified items as selected, and an item above it to allow for easy navigating into and out of the container:

<Button Content="Button"/>
<muxc:RadioButtons Header="App Mode">
    <x:String>Item 1</x:String>
    <x:String>Item 2</x:String>
    <x:String>Item 3</x:String>
    <x:String>Item 4</x:String>
</muxc:RadioButtons>

Tab to Button, and then tab again to put focus on the first item in the RadioButtons list
Notice that although Item 1 has keyboard focus, selection will not be set until navigation within the list occurs

Expected behavior

Tabbing into the RadioButtons list where no items have been selected yet, should consequently  select the item that has focus

Screenshots

Version Info
Win UI 2.1 Preview
NuGet package version:

Windows 10 version
Saw the problem?

Insider Build (18855)
Yes

October 2018 Update (17763)

April 2018 Update (17134)

Fall Creators Update (16299)

Creators Update (15063)

Anniversary Update (14393)

Device form factor
Saw the problem?

Desktop
Yes

Mobile

Xbox

Surface Hub

IoT

Additional context

Great bug. Even greater is this gif. How did you make it? :)

@chigy @kikisaints if there's an easy way for people to make gifs like this, we should doc it somewhere and put it in the bug template. Can you share how you made it?

@chigy @kikisaints if there's an easy way for people to make gifs like this, we should doc it somewhere and put it in the bug template. Can you share how you made it?

For me, it requires Photoshop - but once you have that, it's relatively easy to make.

@kikisaints @jevansaks , it is so fanny but we just created gif for one of our docs. You might want to search for gif creation tools on store. There are multiple free apps out there.

@kikisaints @jevansaks , it is so funny but we just created gif for one of our docs. You might want to search for gif creation tools on store. There are multiple free apps out there.

But just imagine if it was built into the Snipping Tool or the Game Bar...

@chrisglein only if they had Git Repo where we can make requests. :)

@chrisglein Chris Glein FTE only if they had Git Repo where we can make requests. :)

Generally the app teams want feedback and upvotes via Feedback Hub.

This is no longer the desired behavior. Closing.

@kikisaints , what is the desired behavior then?


tf.keras.models.save_model not saving the probabilistic_model

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.04 LTS
TensorFlow installed from (source or binary):binary
TensorFlow version (use command below): v2.5.0-rc3-213-ga4dfb8d1a71 2.5.0
Tensorflow_probability.version:  '0.13.0'
Python version: 3.8.10
CUDA/cuDNN version: cuda_11.2.r11.2/compiler.29373293_0
GPU model and memory: 12Gb TitanXP

Describe the current behavior
Tensorflow model with tensorflow_probability layers creates errors while saving using
** The model is created using the below code**
`
_model = Sequential([
Conv2D(8, 5, activation='relu', padding='valid', input_shape=input_shape),
MaxPooling2D(6),
Flatten(),
Dense(10),
tfpl.OneHotCategorical(10)
])
model.compile(optimizer=optimizer, loss=loss, metrics=metrics)
probabilistic_model = get_probabilistic_model(
input_shape=(28, 28, 1),
loss=nll,
optimizer=RMSprop(),
metrics=['accuracy']
probabilistic_model.fit(x_train, y_train_oh, epochs=5)
_
`

For saving the model
_probabilistic_model.save('/tmp/model/probabilistic_model')_
The saving steps create the error as shown below.
`
_OperatorNotAllowedInGraphError            Traceback (most recent call last)
/tmp/ipykernel_11377/1109926494.py in
----> 1 probabilistic_model.save('/tmp/model/probabilistic_model')
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in save(self, filepath, overwrite, include_optimizer, save_format, signatures, options, save_traces)
2109     """
2110     # pylint: enable=line-too-long
-> 2111     save.save_model(self, filepath, overwrite, include_optimizer, save_format,
2112                     signatures, options, save_traces)
2113
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py in save_model(model, filepath, overwrite, include_optimizer, save_format, signatures, options, save_traces)
148   else:
149     with generic_utils.SharedObjectSavingScope():
--> 150       saved_model_save.save(model, filepath, overwrite, include_optimizer,
151                             signatures, options, save_traces)
152
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save.py in save(model, filepath, overwrite, include_optimizer, signatures, options, save_traces)
87   with K.deprecated_internal_learning_phase_scope(0):
88     with utils.keras_option_scope(save_traces):
---> 89       saved_nodes, node_paths = save_lib.save_and_return_nodes(
90           model, filepath, signatures, options)
91
~/tf2/lib/python3.8/site-packages/tensorflow/python/saved_model/save.py in save_and_return_nodes(obj, export_dir, signatures, options, raise_metadata_warning, experimental_skip_checkpoint)
1101
1102   _, exported_graph, object_saver, asset_info, saved_nodes, node_paths = (
-> 1103       _build_meta_graph(obj, signatures, options, meta_graph_def,
1104                         raise_metadata_warning))
1105   saved_model.saved_model_schema_version = constants.SAVED_MODEL_SCHEMA_VERSION
~/tf2/lib/python3.8/site-packages/tensorflow/python/saved_model/save.py in _build_meta_graph(obj, signatures, options, meta_graph_def, raise_metadata_warning)
1288
1289   with save_context.save_context(options):
-> 1290     return _build_meta_graph_impl(obj, signatures, options, meta_graph_def,
1291                                   raise_metadata_warning)
~/tf2/lib/python3.8/site-packages/tensorflow/python/saved_model/save.py in _build_meta_graph_impl(obj, signatures, options, meta_graph_def, raise_metadata_warning)
1205   checkpoint_graph_view = _AugmentedGraphView(obj)
1206   if signatures is None:
-> 1207     signatures = signature_serialization.find_function_to_export(
1208         checkpoint_graph_view)
1209
~/tf2/lib/python3.8/site-packages/tensorflow/python/saved_model/signature_serialization.py in find_function_to_export(saveable_view)
97   # If the user did not specify signatures, check the root object for a function
98   # that can be made into a signature.
---> 99   functions = saveable_view.list_functions(saveable_view.root)
100   signature = functions.get(DEFAULT_SIGNATURE_ATTR, None)
101   if signature is not None:
~/tf2/lib/python3.8/site-packages/tensorflow/python/saved_model/save.py in list_functions(self, obj)
152     obj_functions = self._functions.get(obj, None)
153     if obj_functions is None:
--> 154       obj_functions = obj._list_functions_for_serialization(  # pylint: disable=protected-access
155           self._serialization_cache)
156       self._functions[obj] = obj_functions
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in _list_functions_for_serialization(self, serialization_cache)
2711     self.test_function = None
2712     self.predict_function = None
-> 2713     functions = super(
2714         Model, self)._list_functions_for_serialization(serialization_cache)
2715     self.train_function = train_function
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py in _list_functions_for_serialization(self, serialization_cache)
3014
3015   def _list_functions_for_serialization(self, serialization_cache):
-> 3016     return (self._trackable_saved_model_saver
3017             .list_functions_for_serialization(serialization_cache))
3018
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/base_serialization.py in list_functions_for_serialization(self, serialization_cache)
90       return {}
91
---> 92     fns = self.functions_to_serialize(serialization_cache)
93
94     # The parent AutoTrackable class saves all user-defined tf.functions, and
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/layer_serialization.py in functions_to_serialize(self, serialization_cache)
71
72   def functions_to_serialize(self, serialization_cache):
---> 73     return (self._get_serialized_attributes(
74         serialization_cache).functions_to_serialize)
75
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/layer_serialization.py in _get_serialized_attributes(self, serialization_cache)
87       return serialized_attr
88
---> 89     object_dict, function_dict = self._get_serialized_attributes_internal(
90         serialization_cache)
91
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/model_serialization.py in _get_serialized_attributes_internal(self, serialization_cache)
51     # the ones serialized by Layer.
52     objects, functions = (
---> 53         super(ModelSavedModelSaver, self)._get_serialized_attributes_internal(
54             serialization_cache))
55     functions['_default_save_signature'] = default_signature
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/layer_serialization.py in _get_serialized_attributes_internal(self, serialization_cache)
97     """Returns dictionary of serialized attributes."""
98     objects = save_impl.wrap_layer_objects(self.obj, serialization_cache)
---> 99     functions = save_impl.wrap_layer_functions(self.obj, serialization_cache)
100     # Attribute validator requires that the default save signature is added to
101     # function dict, even if the value is None.
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save_impl.py in wrap_layer_functions(layer, serialization_cache)
202           if isinstance(fn, LayerCall):
203             fn = fn.wrapped_call
--> 204           fn.get_concrete_function()
205
206   # Restore overwritten functions and losses
/usr/lib/python3.8/contextlib.py in exit(self, type, value, traceback)
118         if type is None:
119             try:
--> 120                 next(self.gen)
121             except StopIteration:
122                 return False
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save_impl.py in tracing_scope()
365       if training is not None:
366         with K.deprecated_internal_learning_phase_scope(training):
--> 367           fn.get_concrete_function(*args, **kwargs)
368       else:
369         fn.get_concrete_function(*args, **kwargs)
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py in get_concrete_function(self, *args, **kwargs)
1365       ValueError: if this object has not yet been called on concrete values.
1366     """
-> 1367     concrete = self._get_concrete_function_garbage_collected(*args, **kwargs)
1368     concrete._garbage_collector.release()  # pylint: disable=protected-access
1369     return concrete
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py in _get_concrete_function_garbage_collected(self, *args, **kwargs)
1282       # In this case we have not created variables on the first call. So we can
1283       # run the first trace but we should fail if variables are created.
-> 1284       concrete = self._stateful_fn._get_concrete_function_garbage_collected(  # pylint: disable=protected-access
1285           *args, **kwargs)
1286       if self._created_variables:
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _get_concrete_function_garbage_collected(self, *args, **kwargs)
3098       args, kwargs = None, None
3099     with self._lock:
-> 3100       graph_function, _ = self._maybe_define_function(args, kwargs)
3101       seen_names = set()
3102       captured = object_identity.ObjectIdentitySet(
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _maybe_define_function(self, args, kwargs)
3442
3443           self._function_cache.missed.add(call_context_key)
-> 3444           graph_function = self._create_graph_function(args, kwargs)
3445           self._function_cache.primary[cache_key] = graph_function
3446
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _create_graph_function(self, args, kwargs, override_flat_arg_shapes)
3277     arg_names = base_arg_names + missing_arg_names
3278     graph_function = ConcreteFunction(
-> 3279         func_graph_module.func_graph_from_py_func(
3280             self._name,
3281             self._python_function,
~/tf2/lib/python3.8/site-packages/tensorflow/python/framework/func_graph.py in func_graph_from_py_func(name, python_func, args, kwargs, signature, func_graph, autograph, autograph_options, add_control_dependencies, arg_names, op_return_value, collections, capture_by_value, override_flat_arg_shapes)
997         _, original_func = tf_decorator.unwrap(python_func)
998
--> 999       func_outputs = python_func(*func_args, **func_kwargs)
1000
1001       # invariant: func_outputs contains only Tensors, CompositeTensors,
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py in wrapped_fn(*args, **kwds)
670         # the function a weak reference to itself to avoid a reference cycle.
671         with OptionalXlaContext(compile_with_xla):
--> 672           out = weak_wrapped_fn().wrapped(*args, **kwds)
673         return out
674
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save_impl.py in wrapper(*args, **kwargs)
597       with autocast_variable.enable_auto_cast_variables(
598           layer._compute_dtype_object):  # pylint: disable=protected-access
--> 599         ret = method(*args, **kwargs)
600     _restore_layer_losses(original_losses)
601     return ret
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/utils.py in wrap_with_training_arg(*args, **kwargs)
163       return wrapped_call(*args, **kwargs)
164
--> 165     return control_flow_util.smart_cond(
166         training, lambda: replace_training_and_call(True),
167         lambda: replace_training_and_call(False))
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/utils/control_flow_util.py in smart_cond(pred, true_fn, false_fn, name)
107     return control_flow_ops.cond(
108         pred, true_fn=true_fn, false_fn=false_fn, name=name)
--> 109   return smart_module.smart_cond(
110       pred, true_fn=true_fn, false_fn=false_fn, name=name)
111
~/tf2/lib/python3.8/site-packages/tensorflow/python/framework/smart_cond.py in smart_cond(pred, true_fn, false_fn, name)
52   if pred_value is not None:
53     if pred_value:
---> 54       return true_fn()
55     else:
56       return false_fn()
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/utils.py in ()
164
165     return control_flow_util.smart_cond(
--> 166         training, lambda: replace_training_and_call(True),
167         lambda: replace_training_and_call(False))
168
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/utils.py in replace_training_and_call(training)
161     def replace_training_and_call(training):
162       set_training_arg(training, training_arg_index, args, kwargs)
--> 163       return wrapped_call(*args, **kwargs)
164
165     return control_flow_util.smart_cond(
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save_impl.py in call(inputs, *args, **kwargs)
679     return layer.keras_api.call  # pylint: disable=protected-access
680   def call(inputs, *args, **kwargs):
--> 681     return call_and_return_conditional_losses(inputs, *args, **kwargs)[0]
682   return _create_call_fn_decorator(layer, call)
683
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save_impl.py in call(self, *args, **kwargs)
637   def call(self, *args, **kwargs):
638     self._maybe_trace(args, kwargs)
--> 639     return self.wrapped_call(*args, **kwargs)
640
641   def get_concrete_function(self, *args, **kwargs):
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py in call(self, *args, **kwds)
887
888       with OptionalXlaContext(self._jit_compile):
--> 889         result = self._call(*args, **kwds)
890
891       new_tracing_count = self.experimental_get_tracing_count()
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py in _call(self, *args, **kwds)
922       # In this case we have not created variables on the first call. So we can
923       # run the first trace but we should fail if variables are created.
--> 924       results = self._stateful_fn(*args, **kwds)
925       if self._created_variables:
926         raise ValueError("Creating variables on a non-first call to a function"
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/function.py in call(self, *args, **kwargs)
3020     with self._lock:
3021       (graph_function,
-> 3022        filtered_flat_args) = self._maybe_define_function(args, kwargs)
3023     return graph_function._call_flat(
3024         filtered_flat_args, captured_inputs=graph_function.captured_inputs)  # pylint: disable=protected-access
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _maybe_define_function(self, args, kwargs)
3442
3443           self._function_cache.missed.add(call_context_key)
-> 3444           graph_function = self._create_graph_function(args, kwargs)
3445           self._function_cache.primary[cache_key] = graph_function
3446
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _create_graph_function(self, args, kwargs, override_flat_arg_shapes)
3277     arg_names = base_arg_names + missing_arg_names
3278     graph_function = ConcreteFunction(
-> 3279         func_graph_module.func_graph_from_py_func(
3280             self._name,
3281             self._python_function,
~/tf2/lib/python3.8/site-packages/tensorflow/python/framework/func_graph.py in func_graph_from_py_func(name, python_func, args, kwargs, signature, func_graph, autograph, autograph_options, add_control_dependencies, arg_names, op_return_value, collections, capture_by_value, override_flat_arg_shapes)
997         _, original_func = tf_decorator.unwrap(python_func)
998
--> 999       func_outputs = python_func(*func_args, **func_kwargs)
1000
1001       # invariant: func_outputs contains only Tensors, CompositeTensors,
~/tf2/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py in wrapped_fn(*args, **kwds)
670         # the function a weak reference to itself to avoid a reference cycle.
671         with OptionalXlaContext(compile_with_xla):
--> 672           out = weak_wrapped_fn().wrapped(*args, **kwds)
673         return out
674
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save_impl.py in wrapper(*args, **kwargs)
597       with autocast_variable.enable_auto_cast_variables(
598           layer._compute_dtype_object):  # pylint: disable=protected-access
--> 599         ret = method(*args, **kwargs)
600     _restore_layer_losses(original_losses)
601     return ret
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/utils.py in wrap_with_training_arg(*args, **kwargs)
163       return wrapped_call(*args, **kwargs)
164
--> 165     return control_flow_util.smart_cond(
166         training, lambda: replace_training_and_call(True),
167         lambda: replace_training_and_call(False))
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/utils/control_flow_util.py in smart_cond(pred, true_fn, false_fn, name)
107     return control_flow_ops.cond(
108         pred, true_fn=true_fn, false_fn=false_fn, name=name)
--> 109   return smart_module.smart_cond(
110       pred, true_fn=true_fn, false_fn=false_fn, name=name)
111
~/tf2/lib/python3.8/site-packages/tensorflow/python/framework/smart_cond.py in smart_cond(pred, true_fn, false_fn, name)
52   if pred_value is not None:
53     if pred_value:
---> 54       return true_fn()
55     else:
56       return false_fn()
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/utils.py in ()
164
165     return control_flow_util.smart_cond(
--> 166         training, lambda: replace_training_and_call(True),
167         lambda: replace_training_and_call(False))
168
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/utils.py in replace_training_and_call(training)
161     def replace_training_and_call(training):
162       set_training_arg(training, training_arg_index, args, kwargs)
--> 163       return wrapped_call(*args, **kwargs)
164
165     return control_flow_util.smart_cond(
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/save_impl.py in call_and_return_conditional_losses(*args, **kwargs)
661   def call_and_return_conditional_losses(*args, **kwargs):
662     """Returns layer (call_output, conditional losses) tuple."""
--> 663     call_output = layer_call(*args, **kwargs)
664     if version_utils.is_v1_layer_or_model(layer):
665       conditional_losses = layer.get_losses_for(
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/engine/sequential.py in call(self, inputs, training, mask)
378       if not self.built:
379         self._init_graph_network(self.inputs, self.outputs)
--> 380       return super(Sequential, self).call(inputs, training=training, mask=mask)
381
382     outputs = inputs  # handle the corner case where self.layers is empty
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/engine/functional.py in call(self, inputs, training, mask)
418         a list of tensors if there are more than one outputs.
419     """
--> 420     return self._run_internal_graph(
421         inputs, training=training, mask=mask)
422
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/engine/functional.py in _run_internal_graph(self, inputs, training, mask)
554
555         args, kwargs = node.map_arguments(tensor_dict)
--> 556         outputs = node.layer(*args, **kwargs)
557
558         # Update tensor_dict.
~/tf2/lib/python3.8/site-packages/tensorflow_probability/python/layers/distribution_layer.py in call(self, inputs, *args, **kwargs)
228   def call(self, inputs, *args, **kwargs):
229     self._enter_dunder_call = True
--> 230     distribution, _ = super(DistributionLambda, self).call(
231         inputs, *args, **kwargs)
232     self._enter_dunder_call = False
~/tf2/lib/python3.8/site-packages/tensorflow/python/framework/ops.py in iter(self)
518   def iter(self):
519     if not context.executing_eagerly():
--> 520       self._disallow_iteration()
521
522     shape = self._shape_tuple()
~/tf2/lib/python3.8/site-packages/tensorflow/python/framework/ops.py in _disallow_iteration(self)
511       self._disallow_when_autograph_disabled("iterating over tf.Tensor")
512     elif ag_ctx.control_status_ctx().status == ag_ctx.Status.ENABLED:
--> 513       self._disallow_when_autograph_enabled("iterating over tf.Tensor")
514     else:
515       # Default: V1-style Graph execution.
~/tf2/lib/python3.8/site-packages/tensorflow/python/framework/ops.py in _disallow_when_autograph_enabled(self, task)
487
488   def _disallow_when_autograph_enabled(self, task):
--> 489     raise errors.OperatorNotAllowedInGraphError(
490         "{} is not allowed: AutoGraph did convert this function. This might"
491         " indicate you are trying to use an unsupported feature.".format(task))
OperatorNotAllowedInGraphError: iterating over tf.Tensor is not allowed: AutoGraph did convert this function. This might indicate you are trying to use an unsupported feature._
`
Workaround works with limited capability as shown in https://github.com/tensorflow/probability/issues/325#issuecomment-477213850
But this only saves the weights and not other details of the model.
Workaround works with h5 format
h5 format saving works, but cannot load the model
`
loaded_model = tf.keras.models.load_model('/tmp/model/probabilistic_model.h5')
Error while using h5 format for saving and then loading the model is shown below.
ValueError                                Traceback (most recent call last)
/tmp/ipykernel_11377/686337657.py in
----> 1 loaded_model = tf.keras.models.load_model('/tmp/model/probabilistic_model.h5')
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py in load_model(filepath, custom_objects, compile, options)
199         if (h5py is not None and
200             (isinstance(filepath, h5py.File) or h5py.is_hdf5(filepath))):
--> 201           return hdf5_format.load_model_from_hdf5(filepath, custom_objects,
202                                                   compile)
203
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/hdf5_format.py in load_model_from_hdf5(filepath, custom_objects, compile)
178       model_config = model_config.decode('utf-8')
179     model_config = json_utils.decode(model_config)
--> 180     model = model_config_lib.model_from_config(model_config,
181                                                custom_objects=custom_objects)
182
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/saving/model_config.py in model_from_config(config, custom_objects)
57                     'Sequential.from_config(config)?')
58   from tensorflow.python.keras.layers import deserialize  # pylint: disable=g-import-not-at-top
---> 59   return deserialize(config, custom_objects=custom_objects)
60
61
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/layers/serialization.py in deserialize(config, custom_objects)
157   """
158   populate_deserializable_objects()
--> 159   return generic_utils.deserialize_keras_object(
160       config,
161       module_objects=LOCAL.ALL_OBJECTS,
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
666
667       if 'custom_objects' in arg_spec.args:
--> 668         deserialized_obj = cls.from_config(
669             cls_config,
670             custom_objects=dict(
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/engine/sequential.py in from_config(cls, config, custom_objects)
495     model = cls(name=name)
496     for layer_config in layer_configs:
--> 497       layer = layer_module.deserialize(layer_config,
498                                        custom_objects=custom_objects)
499       model.add(layer)
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/layers/serialization.py in deserialize(config, custom_objects)
157   """
158   populate_deserializable_objects()
--> 159   return generic_utils.deserialize_keras_object(
160       config,
161       module_objects=LOCAL.ALL_OBJECTS,
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
651     # In this case we are dealing with a Keras config dictionary.
652     config = identifier
--> 653     (cls, cls_config) = class_and_config_for_serialized_keras_object(
654         config, module_objects, custom_objects, printable_module_name)
655
~/tf2/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py in class_and_config_for_serialized_keras_object(config, module_objects, custom_objects, printable_module_name)
554   cls = get_registered_object(class_name, custom_objects, module_objects)
555   if cls is None:
--> 556     raise ValueError(
557         'Unknown {}: {}. Please ensure this object is '
558         'passed to the custom_objects argument. See '
ValueError: Unknown layer: OneHotCategorical. Please ensure this object is passed to the custom_objects argument. See https://www.tensorflow.org/guide/keras/save_and_serialize#registering_the_custom_object for details.
`
Describe the expected behavior
Saves a probabilistic_model as a TensorFlow SavedModel

@rrklearn2020
Could you please provide the colab gist with the required dependencies to analyse the issue better. Thanks

@UsharaniPagadala
I have uploaded the file to GitHub and the link is shared below.
https://github.com/rrklearn2020/probabilistic_model_trials.git

@rrklearn2020
Could you please provide the collab gist with the required dependencies to analyze the issue better. Thanks

@UsharaniPagadala
I have uploaded the file to GitHub and the link is shared below.
https://github.com/rrklearn2020/probabilistic_model_trials.git
Complete details are shared with this link.

@rrklearn2020
Please post this issue on keras-team/keras repo.
To know more refer to:https://discuss.tensorflow.org/t/keras-project-moved-to-new-repository-in-https-github-com-keras-team-keras/1999

The issue is not yet solved, waiting for support.

@rrklearn2020
It looks like the Issue relates to the Keras component. Please submit it to the github.com/keras-team/keras repository instead. As previously announced all future development of Keras is expected to happen in the keras-team/keras repository. If your issue lies with the TF-Core area please comment back with your explanation and we can look into it further. Thanks!

@UsharaniPagadala
the issue was posted to Keras git (link shared - 12 days before), but till today, no solution.
It would be a great help if the Tensorflow team and Keras team can support together as one team to solve this issue of saving a TF probabilistic_model as a 'TensorFlow SavedModel'

@rrklearn2020
Could you please share that issue link posted in Keras-team/keras. Thanks

@UsharaniPagadala I had already posted the issue link posted in Keras-team/keras, 19 days ago,
The link is shared below.
https://github.com/keras-team/keras/issues/15024

@rrklearn2020
Could you please move this to closed status as it is tracking  in keras-team/keras repo. Thanks

Before closing the ticket, It would be a great help if the Tensorflow team and Keras team can support together as one team to solve this issue of saving a TF probabilistic_model as a 'TensorFlow SavedModel'

@rrklearn2020
Thanks for the update,sure we will do that

The issue is not yet solved, waiting for support.

This is still a problem that significantly limits the utility of the tensorflow probability layers. Great if we could save keras models with tensorflow probability layers please.

Hi,
Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.
The Tensorflow team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TensorFlow version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate.
Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow space.


Add kube_leader mixin to monitor leader elections

What does this PR do?
The upcoming kube_scheduler and kube_controller_manager need to monitor the status of the leader-election for these components, in order to ensure there is a healthy leader at all times. This PR introduces this logic as a mixin in the base package. It can be tested with the following custom class:
from checks import AgentCheck
from datadog_checks.base.checks.kube_leader import KubeLeaderElectionMixin

class KubeLeaderCheck(AgentCheck, KubeLeaderElectionMixin):
    def check(self, instance):
        self.check_election_status(instance)

and these instances:
init_config:
instances:
  - namespace: "kube_controller_manager"
    record_kind: "endpoints"
    record_name: "kube-controller-manager"
    record_namespace: "kube-system"
    tags:
      - "test:tag"
  - namespace: "cluster_agent"
    record_kind: "configmap"
    record_name: "datadog-leader-election"
    record_namespace: "default"

Motivation
What inspired you to submit this pull request?
Review checklist

[x] PR has a meaningful title or PR has the no-changelog label attached
[x] Feature or bugfix has tests
[x] Git history is clean
~[ ] If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo~
~[ ] If PR adds a configuration option, it has been added to the configuration file.~

Additional Notes
This PR uses the official python kube client library as it provides:

the in-cluster and from-file configuration logics, mirroring the behavior we have on the go side
facilities for rfc3339 date parsing

Codecov Report

Merging #2796 into master will decrease coverage by 7.69%.
The diff coverage is 96.42%.

@@            Coverage Diff             @@
##           master    #2796      +/-   ##
==========================================
- Coverage   84.75%   77.05%    -7.7%
==========================================
  Files         659       49     -610
  Lines       37793     3487   -34306
  Branches     4539      410    -4129
==========================================
- Hits        32031     2687   -29344
+ Misses       4427      701    -3726
+ Partials     1335       99    -1236

Fixed the unused imports, and moved the mixin to it own package, that will be imported by the related checks only


Null safety

Thanks for the great package!
Do you plan to make a null safe update of the package?

Just pushed V1.0.0

on that note, I'm getting:
I/flutter (10765): FLUTTER ERROR: 'package:flutter/src/widgets/overlay.dart': Failed assertion: line 134 pos 12: '_overlay != null': is not true.
I/flutter (10765): #2      OverlayEntry.remove (package:flutter/src/widgets/overlay.dart:134:12)
I/flutter (10765): #3      SuperTooltip.close (package:super_tooltip/super_tooltip.dart:196:20)
I/flutter (10765): #4      _RotateTipWrapperState.initState.<anonymous closure> (package:trainr_mobile/features/workout/widgets/workout_rotate_tip.dart:44:17)
I/flutter (10765): (elided 14 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)

so I'm guessing there should be ? instead of ! here: https://github.com/escamoteur/super_tooltip/blob/master/lib/super_tooltip.dart#L199
This happens when I tap somewhere outside the Tooltip to close it.

on that note, I'm getting:
I/flutter (10765): FLUTTER ERROR: 'package:flutter/src/widgets/overlay.dart': Failed assertion: line 134 pos 12: '_overlay != null': is not true.
I/flutter (10765): #2      OverlayEntry.remove (package:flutter/src/widgets/overlay.dart:134:12)
I/flutter (10765): #3      SuperTooltip.close (package:super_tooltip/super_tooltip.dart:196:20)
I/flutter (10765): #4      _RotateTipWrapperState.initState.<anonymous closure> (package:xxxx/features/xxx/yyy/workout_rotate_tip.dart:44:17)
I/flutter (10765): (elided 14 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)

so I'm guessing there should be ? instead of ! here: https://github.com/escamoteur/super_tooltip/blob/master/lib/super_tooltip.dart#L199
This happens when I tap somewhere outside the Tooltip to close it.


Start Page blank

Operation System: OSX Sierra 10.12.6
Beaker Version: 0.7.5
Fresh installed latest release version. Start pages are blank with below console output:
Failed to load resource: the server responded with a status of 404 (OK)
main.js:683 Uncaught (in promise) Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: bookmarks.profileId, bookmarks.url
    at loadBookmarks (main.js:886)
    at setup (main.js:649)
    at Object.1.builtin-pages-lib (main.js:647)
    at s (main.js:1)
    at e (main.js:1)
    at main.js:1

Ah that's no good at all. I think our new default bookmarks may have caused it. I'll get into it this afternoon.

@sull can you try the remove-default-bookmarks branch for me?

I could not get it to run. Will try again later today.
Error: Cannot find module 'pauls-electron-rpc' ...

Bleh that may be some npm nonsense. You may have to burnthemall after checking out the branch.

I cleared out my beaker applications directory and it looks good now.
prob had overlap/corruption from a build i run sometimes and the released binary.


libvirt_domain disk: wwn constantly recalculated - constant changes

System Information
Linux distribution
Red Hat Enterprise Linux release 8.8 (Ootpa)
Terraform version
Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/dmacvicar/libvirt v0.7.1

Provider and libvirt versions
.terraform/providers/registry.terraform.io/dmacvicar/libvirt/0.7.1/linux_amd64/terraform-provider-libvirt_v0.7.1 0.7.1

Checklist

[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?

[ ] Make sure you explain why this option is important to you, why it should be important to everyone. Describe your use-case with detail and provide examples where possible.
[ ] If it is a very special case, consider using the XSLT support in the provider to tweak the definition instead of opening an issue
[ ] Maintainers do not have expertise in every libvirt setting, so please, describe the feature and how it is used. Link to the appropriate documentation

[X] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:

Description of Issue/Question
Setup
terraform {
  required_providers {
    libvirt = {
      source  = "dmacvicar/libvirt"
      version = "0.7.1"
    }
  }
}

provider "libvirt" {
  uri = "qemu:///system"
}

locals {
  default_volume_source_uri = "/data/templates/ubuntu.qcow2"
  images_directory = "/var/lib/libvirt/images"

  # From https://wiki.swisscom.com/x/ZkpsHw
  vm_name = "example-vm"
  vcpus   = "2"
  memory  = "4096"
}

resource "libvirt_domain" "default" {
  name        = local.vm_name
  vcpu        = local.vcpus
  memory      = local.memory

  disk {
    volume_id = libvirt_volume.os.id
    scsi      = true
  }
}

resource "libvirt_pool" "default" {
  name = local.vm_name
  path = join("/", [local.images_directory, local.vm_name])
  type = "dir"
}

resource "libvirt_volume" "default" {
  name   = basename(local.default_volume_source_uri)
  format = split(".", local.default_volume_source_uri)[length(split(".", local.default_volume_source_uri)) - 1]
  pool   = libvirt_pool.default.name
  source = local.default_volume_source_uri
}

# volume to attach to the "default" domain as OS disk
resource "libvirt_volume" "os" {
  # count=1

  name           = join("_", [local.vm_name, "os.qcow2"])
  base_volume_id = libvirt_volume.default.id
  format         = split(".", local.default_volume_source_uri)[length(split(".", local.default_volume_source_uri)) - 1]
  pool           = libvirt_pool.default.name
}

Steps to Reproduce Issue
terraform apply -auto-approve && terraform apply -auto-approve
[root@htcl-kvm-zbl-111 lv-bug] [DEV]# terraform apply -auto-approve && terraform apply -auto-approve
libvirt_pool.default: Refreshing state... [id=e34e17f7-ccdb-46a2-b2af-1b9eb19efd7a]
libvirt_volume.default: Refreshing state... [id=/var/lib/libvirt/images/example-vm/ubuntu.qcow2]
libvirt_volume.os: Refreshing state... [id=/var/lib/libvirt/images/example-vm/example-vm_os.qcow2]
libvirt_domain.default: Refreshing state... [id=69b89de7-c53f-435f-9e59-e389b2c923a8]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # libvirt_domain.default will be updated in-place
  ~ resource "libvirt_domain" "default" {
        id          = "69b89de7-c53f-435f-9e59-e389b2c923a8"
        name        = "example-vm"
        # (10 unchanged attributes hidden)

      ~ disk {
          - wwn       = "05abcd285c6230c9" -> null
            # (2 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
libvirt_domain.default: Modifying... [id=69b89de7-c53f-435f-9e59-e389b2c923a8]
libvirt_domain.default: Modifications complete after 0s [id=69b89de7-c53f-435f-9e59-e389b2c923a8]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
libvirt_pool.default: Refreshing state... [id=e34e17f7-ccdb-46a2-b2af-1b9eb19efd7a]
libvirt_volume.default: Refreshing state... [id=/var/lib/libvirt/images/example-vm/ubuntu.qcow2]
libvirt_volume.os: Refreshing state... [id=/var/lib/libvirt/images/example-vm/example-vm_os.qcow2]
libvirt_domain.default: Refreshing state... [id=69b89de7-c53f-435f-9e59-e389b2c923a8]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # libvirt_domain.default will be updated in-place
  ~ resource "libvirt_domain" "default" {
        id          = "69b89de7-c53f-435f-9e59-e389b2c923a8"
        name        = "example-vm"
        # (10 unchanged attributes hidden)

      ~ disk {
          - wwn       = "05abcd285c6230c9" -> null
            # (2 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
libvirt_domain.default: Modifying... [id=69b89de7-c53f-435f-9e59-e389b2c923a8]
libvirt_domain.default: Modifications complete after 0s [id=69b89de7-c53f-435f-9e59-e389b2c923a8]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

As can be seen there, the wwn attribute of the resource libvirt_domain.default => disk { … } would be reset for every run. This results in constant changes.
If libvirt_domain.default.disk.scsi is set to false, the issue does not surface.

Additional information:
Do you have SELinux or Apparmor/Firewall enabled? Some special configuration?
Have you tried to reproduce the issue without them enabled?
n/a

It also seems to be impossible to override the wwn with a random string. In the source code, I'm now setting it to a fixed value:
resource "libvirt_domain" "default" {
  # …
  disk {
    volume_id = libvirt_volume.os.id
    scsi      = true
    wwn       = "2027eb2388d3f2e6"
  }
  # …
}

Runs of terraform apply -auto-approve && terraform apply -auto-approve show that the value is not stored.
libvirt_pool.default: Refreshing state... [id=e7d1e51b-87a0-4b9d-b580-2fafe7473cd5]
random_string.disk_os_wwn: Refreshing state... [id=2027eb2388d3f2e6]
libvirt_volume.default: Refreshing state... [id=/var/lib/libvirt/images/example/ubuntu.qcow2]
libvirt_volume.data[1]: Refreshing state... [id=/var/lib/libvirt/images/example/data_1.qcow2]
libvirt_volume.data[2]: Refreshing state... [id=/var/lib/libvirt/images/example/data_2.qcow2]
libvirt_volume.data[0]: Refreshing state... [id=/var/lib/libvirt/images/example/data_0.qcow2]
libvirt_volume.os: Refreshing state... [id=/var/lib/libvirt/images/example/example_os.qcow2]
random_string.disks_data_wwn[2]: Refreshing state... [id=0442395cc370fb38]
random_string.disks_data_wwn[1]: Refreshing state... [id=c44f1979e5109b54]
random_string.disks_data_wwn[0]: Refreshing state... [id=8e1b7db0d61e170c]
libvirt_domain.default: Refreshing state... [id=411e8833-9574-4c9e-94dd-c05371c9deb2]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # libvirt_domain.default will be updated in-place
  ~ resource "libvirt_domain" "default" {
        id          = "411e8833-9574-4c9e-94dd-c05371c9deb2"
        name        = "example"
        # (11 unchanged attributes hidden)

      ~ disk {
          ~ wwn       = "05abcdf8df2189e9" -> "2027eb2388d3f2e6"
            # (2 unchanged attributes hidden)
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
libvirt_domain.default: Modifying... [id=411e8833-9574-4c9e-94dd-c05371c9deb2]
libvirt_domain.default: Modifications complete after 0s [id=411e8833-9574-4c9e-94dd-c05371c9deb2]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
libvirt_pool.default: Refreshing state... [id=e7d1e51b-87a0-4b9d-b580-2fafe7473cd5]
random_string.disk_os_wwn: Refreshing state... [id=2027eb2388d3f2e6]
libvirt_volume.default: Refreshing state... [id=/var/lib/libvirt/images/example/ubuntu.qcow2]
libvirt_volume.data[2]: Refreshing state... [id=/var/lib/libvirt/images/example/data_2.qcow2]
libvirt_volume.data[1]: Refreshing state... [id=/var/lib/libvirt/images/example/data_1.qcow2]
libvirt_volume.data[0]: Refreshing state... [id=/var/lib/libvirt/images/example/data_0.qcow2]
libvirt_volume.os: Refreshing state... [id=/var/lib/libvirt/images/example/example_os.qcow2]
random_string.disks_data_wwn[0]: Refreshing state... [id=8e1b7db0d61e170c]
random_string.disks_data_wwn[1]: Refreshing state... [id=c44f1979e5109b54]
random_string.disks_data_wwn[2]: Refreshing state... [id=0442395cc370fb38]
libvirt_domain.default: Refreshing state... [id=411e8833-9574-4c9e-94dd-c05371c9deb2]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # libvirt_domain.default will be updated in-place
  ~ resource "libvirt_domain" "default" {
        id          = "411e8833-9574-4c9e-94dd-c05371c9deb2"
        name        = "example"
        # (11 unchanged attributes hidden)

      ~ disk {
          ~ wwn       = "05abcdf8df2189e9" -> "2027eb2388d3f2e6"
            # (2 unchanged attributes hidden)
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
libvirt_domain.default: Modifying... [id=411e8833-9574-4c9e-94dd-c05371c9deb2]
libvirt_domain.default: Modifications complete after 1s [id=411e8833-9574-4c9e-94dd-c05371c9deb2]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

As you can see, the wwn stays at 05abcdf8df2189e9.

Confirming this seems to be happening to me as well. On Ubuntu 20.04.

Hi,
could you check if this happens with the latest version?

I also discovered the problem, this leaves the provider unusable for me, as a change in wwn forces a replacement.
in state file:
"wwn": ""


Move meshing.lua into the unit tests that use it

Having a lua file with small snippets as part of the regular input files is confusing.  We should move these snippets into the unit tests that use them instead of having it mixed in with the fully functional input files.
https://github.com/LLNL/serac/blob/develop/data/input_files/tests/meshing/meshing.lua

Modify this unit test to have code snippets instead of loading meshing.lua:
https://github.com/LLNL/serac/blob/develop/src/serac/mesh/tests/mesh_generation.cpp
Update this to parsing here to not take a file but to use the code snippets:
https://github.com/LLNL/serac/blob/529f0b7609bb7de967fcceec95a17cc0724a1cc5/src/serac/mesh/tests/mesh_generation.cpp#L39-L50


Test: Improved --wait behaviour

Refs: https://github.com/Microsoft/vscode/issues/24327

[x] Win - @auchenberg
[x] Mac - @sandy081
[x] Linux - @aeschli

Complexity: 2
Running code with --wait parameter from the command line makes the command line process wait until the window that opens is closed. During this milestone we are now tracking the file to open as argument and also terminate the calling process when all the files are closed. This allows to reuse an existing Code instance for this purpose.

verify you can use --wait with 0, 1 or many files and the calling process terminates when the files close
verify the command line will terminate also when the target window closes or when the target window gets another folder opened

Looks good on Windows 10 RS2.


[CP] Disable graph intrinsics for implicit getters with unboxed record return values

Commit(s) to merge
86c18251b462a68b64a00e14fb39e292441193ff
Target
stable
Prepared changelist for beta/stable
https://dart-review.googlesource.com/c/sdk/+/304760
Issue Description
AOT compiler crashed when generating an intrinsic for implicit getter returning an unboxed record. The implicit getter is needed only if it is polymorphic and not inlined.
What is the fix
Generation of intrinsics for implicit getters are disabled when the return value is an unboxed record.
Why cherry-pick
There are no easy workarounds for users.
Risk
low
Issue link(s)
https://github.com/dart-lang/sdk/issues/52449
Extra Info
No response

CP looks good: the fix is trivial. I support.


Improve reporting of missing/incorrect authorization in remote operations

Currently, when using a non-anonymous-allowing remote server without specifying credentials, the Maven mojos fail with generic I/O exceptions. It would be better to catch the specific response code and display an appropriate error message to the user.

There's similar trouble when the tooling isn't installed at all. It presumably received 404s, but outputs generic errors:
Feb 12, 2021 5:06:02 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://surinam.galaxia:9001: Broken pipe (Write failed)
Feb 12, 2021 5:06:02 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://surinam.galaxia:9001
Feb 12, 2021 5:06:02 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://surinam.galaxia:9001: Broken pipe (Write failed)
Feb 12, 2021 5:06:02 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://surinam.galaxia:9001
Feb 12, 2021 5:06:02 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://surinam.galaxia:9001: Protocol wrong type for socket (Write failed)
Feb 12, 2021 5:06:02 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://surinam.galaxia:9001


Added duration (in mins) optional to limit lengths

I did this without your latest changes. I only made it work for year / month selection. Maybe we should add it to the others, but I dunno.
I know nothing about ruby, so I am not sure if I did things right here.

ping :)

O'rly

yeah, I'm trying to bring my oss stuff up to date. 😃


Small changes to make it work on Windows

Two changes:
1/ see Issue#7: os.path doesn't use a valid separator on windows to construct an url.
Use of urllib instead.
2/ test_time was raising an AttributeError because of signal.SIGALRM, which doesn't exist on windows.
Small tweak to make the test not care if there is no SIGALRM.

That seems great ! If I had an "AUTHORS" file, I'd suggest to add you it it, but I don't even have this... This project clearly needs a bit of work 😅
Note : if you just use # and the id of the issue without the word 'Issue', like this : #7 , then github auto-links to the issue, and pings the issue with a back-link to this PR :)


aarch64-linux-gnu libopus.so inclusion

Hey guys,
I have a pine64 which has an arm64 processor.
Whenever I want to use the audiomanager, it crashes since the natives for aarch64-linux-gnu aren't there.
This is easily fixed by recompiling JDA from the source and adding the libopus.so (I could provide that, if necessary) into main/resources/natives/linux-aarch64

I would love to do this, however, I would need to be the one to do the compilation of the libopus.so, specifically for security's sake. If I could get access to an arm64 environment to build and test with, I'd be happy to do it.
For now however, you can prevent jda from crashing by disabling audio with JDABuilder

There's no need for that. I found and actually easier way to import the required file.
But yeah, in that case I can understand that you can't include it.
Thanks either way!
You could get access to an arm64 environment with either the pine64 or the (newish) pi3, if you're really interested into buying one.
I guess this can be closed now! Thanks again for the quick response.

Yeah, it is just the source of the compiled file that I'm concerned about. Just for the sake security.
If someone provides me with 10 minutes of ssh access on an arm64 environment I'll be sure to include it.


Security concerns.

Hello, I would like to ask if by using RDP in general but even more when using rdpwrap it is possible for a computer to be reachable behind a firewall and no static IP.
Example: a home network behind an ADSL modem with firewall enabled. No static IP, as usual. Is it possible to reach the computer in the home network, from a computer outside the LAN?
Thanks!

You'll need to open RDP port on router/modem to reach the destination computer.

Thanks. So if I open the default port 3389 the computer should be reachable, but how do I identify it? From within the LAN I can use the Computer's Name, but that certainly can not be unique, so how do I identify that I whish to connect to the specific computer?

You can give the computer a static lan address (<IP_ADDRESS> or <IP_ADDRESS>) in your modem/router config and set a simple host (rdphost) as for outside access you can run a dynamic IP update (afraid.org/noip/dnydns) create an easy to remember host for the dynamic IP

So, unless port 3389 is open and someone knows my "outside" IP address, my PC should be unreachable from the outside world, regarding RDP? My concern is really that somehow my PC might be exposed to the internet, which I do NOT want, hence the thread title "Security concerns." Also, how certain can we be of the implementation of rdpwrap, regarding some bug which might expose the PC?

So, unless port 3389 is open and someone knows my "outside" IP address, my PC should be unreachable from the outside world, regarding RDP?

Yes.

My concern is really that somehow my PC might be exposed to the internet, which I do NOT want, hence the thread title "Security concerns."

Since somebody doesn't know your login and password, it doesn't matter your PC is reachable via Internet or not.

Also, how certain can we be of the implementation of rdpwrap, regarding some bug which might expose the PC?

It's technically impossible to introduce such bugs, RDP Wrapper doesn't modify protocol or network packets.

Thank you for your thorough answer! Is there a way to log the rdp login attempts to my PC? Is there some log file or something like that?

Yes, each login try is logged into Windows Event Log.
Also see issue #108, it might be related.

You definitely DO NOT want to open port 3389 to the world.  You are better off using ssh, perhaps from this project [1], with an authorized_keys entry that you KNOW is good (your own) while also disallowing password login of ssh.  You should also restrict the remote IP address to ones that you know and trust if you can.  The idea is to securely login, then do port forwarding from ssh to localhost port 3389 for RDP.
[1] https://github.com/PowerShell/Win32-OpenSSH/wiki

My concern is really that somehow my PC might be exposed to the internet, which I do NOT want, hence the thread title "Security concerns."

Since somebody doesn't know your login and password, it doesn't matter your PC is reachable via Internet or not.

It matters. Login and password doesn't protects you fully. Bah. You should feel "naked" if you use login and password only. As RDPWrapper uses only binaries provided by M$ & RDP was proven to be very weak you might want to read the @affinityv answer or my suggestion based on your question, you are not well "educated" (no hard feelings) in security & IT so don't even touch that ground (3rd) or read about it and learn how & what can happen if you do that.


Change lifetime bounds to allow copying references

This branch changes lifetime bounds of BorrowedMutFields to allow copying references. (fixes #118)
Struct definition:
#[self_referencing]
struct CopyRef {
    data: String,
    #[borrows(data)]
    #[covariant]
    ref1: Option<&'this str>,
    #[borrows(data)]
    #[covariant]
    ref2: Option<&'this str>,
    other: String,
}

Generated code:
pub(super) struct BorrowedMutFields<'outer_borrow, 'this2, 'this1, 'this0>
where
    'static: 'this0,
    'static: 'this1,
    'static: 'this2,
    'this2: 'this1,
    'this1: 'this2,
    'this2: 'this0,
    'this0: 'this2,
{
    pub(super) other: &'outer_borrow mut String,
    pub(super) ref2: &'outer_borrow mut Option<&'this0 str>,
    pub(super) ref1: &'outer_borrow mut Option<&'this1 str>,
    pub(super) data: &'this2 String,
}

Test:
let mut s = CopyRefBuilder {
    data: "test".to_string(),
    ref1_builder: |_| None,
    ref2_builder: |x| Some(x),
    other: "other".to_string(),
}.build();

s.with_mut(|f| {
    *f.ref2 = *f.ref1;
});
s.with_mut(|f| {
    *f.ref1 = *f.ref2;
});
s.with_mut(|f| {
    *f.ref1 = Some(f.data);
});
/* compile error
s.with_mut(|f| {
    *f.ref1 = Some(f.other);
});
*/

Your example produces these errors:
error[E0597]: `s` does not live long enough
  --> scratch/src/main.rs:27:5
   |
16 |       let mut s = CopyRefBuilder {
   |           ----- binding `s` declared here
...
27 |       s.with_mut(|f| {
   |       ^ borrowed value does not live long enough
   |  _____|
   | |
28 | |         *f.ref1 = *f.ref2;
29 | |     });
   | |______- argument requires that `s` is borrowed for `'static`
...
36 |   }
   |   - `s` dropped here while still borrowed

error[E0499]: cannot borrow `s` as mutable more than once at a time
  --> scratch/src/main.rs:30:5
   |
27 |       s.with_mut(|f| {
   |       - first mutable borrow occurs here
   |  _____|
   | |
28 | |         *f.ref1 = *f.ref2;
29 | |     });
   | |______- argument requires that `s` is borrowed for `'static`
30 |       s.with_mut(|f| {
   |       ^ second mutable borrow occurs here

Try updating your test case to reflect the usage in your example.

@someguynamedjosh I added a new test case.

$ cargo test
...
test ok_tests::copy_ref1 ... ok
test ok_tests::copy_ref2 ... ok

My bad, I forgot to switch away from the main branch after cloning your repo.

With this change, I can do the following:
use ouroboros::self_referencing;

#[self_referencing]
struct CopyRef {
    data: String,
    #[borrows(data)]
    #[covariant]
    ref1: Option<&'this str>,
    other: String,
    #[borrows(data, other)]
    #[covariant]
    ref2: Option<&'this str>,
}
fn main() {
    println!("Hello, world!");
    let mut s = CopyRefBuilder {
        data: "test".to_string(),
        ref1_builder: |_| None,
        other: "other".to_string(),
        ref2_builder: |x, _| Some(x),
    }
    .build();

    s.with_mut(|f| {
        *f.ref2 = Some(f.other);
        *f.ref1 = *f.ref2;
    });

    drop(s);
}

Which triggers a use-after-free.

It's worth noting that these lifetime bounds:
    'this2: 'this1,
    'this1: 'this2,

Require that 'this1 and 'this2 are exactly the same lifetime, so you should just use a single 'this if that is your intention.

@someguynamedjosh I fixed lifetime bounds as follows:
If the set of variables borrowed by reference a is a subset of the set of variables borrowed by reference b, then 'a: 'b.
For example:
#[self_referencing]
struct CopyRef {
    data: String,
    #[borrows(data)]
    ref1: &'this str,
    other: String,
    #[borrows(data, other)]
    ref2: &'this str,
}

In this case, {data} is a subset of {data, other}, so *ref2 = *ref1 is ok, but *ref2 = *ref1 is invalid.

Thank you for continuing to look into this. It looks like this update allows the original issue again:
use ouroboros::self_referencing;

#[self_referencing]
struct CopyRef {
    data: String,
    #[borrows(data)]
    #[covariant]
    ref1: Option<&'this str>,
    other: String,
    #[borrows(other)]
    #[covariant]
    ref2: Option<&'this str>,
}

fn main() {
    println!("Hello, world!");
    let mut s = CopyRefBuilder {
        data: "test".to_string(),
        ref1_builder: |_| None,
        other: "other".to_string(),
        ref2_builder: |_| None,
    }
    .build();

    s.with_mut(|f| {
        *f.ref1 = Some(f.other);
    });

    drop(s);
}

Thank you for continuing to look into this. It looks like this update allows the original issue again:
use ouroboros::self_referencing;

#[self_referencing]
struct CopyRef {
    data: String,
    #[borrows(data)]
    #[covariant]
    ref1: Option<&'this str>,
    other: String,
    #[borrows(other)]
    #[covariant]
    ref2: Option<&'this str>,
}

fn main() {
    let mut s = CopyRefBuilder {
        data: "test".to_string(),
        ref1_builder: |_| None,
        other: "other".to_string(),
        ref2_builder: |_| None,
    }
    .build();

    s.with_mut(|f| {
        *f.ref1 = Some(f.other);
    });

    drop(s);
}

@someguynamedjosh I fixed a bug and added a new fail test.
I think the code you mentioned no longer works.

Sorry for the delay. Your fix does indeed solve the above issue.
I've now done some more testing and found that mutably borrowing a field that itself borrows other fields yields a compiler error since that causes the intermediate field to no longer be considered a "tail" field, excluding it from the BorrowedMutFields struct:
#[self_referencing]
struct Chained {
    data: String,
    #[borrows(data)]
    ref_a: &'this str,
    #[borrows(mut ref_a)]
    ref_b: &'this mut &'this str,
}

error[E0392]: lifetime parameter `'this1` is never used
 --> scratch/src/main.rs:3:1
  |
3 | #[self_referencing]
  | ^^^^^^^^^^^^^^^^^^^ unused lifetime parameter
  |
  = help: consider removing `'this1`, referring to it in a field, or using a marker such as `PhantomData`
  = note: this error originates in the attribute macro `self_referencing` (in Nightly builds, run with -Z macro-backtrace for more info)

If I go in and add a PhantomData whenever this comes up, I am able to do some trickery with mutable references to trigger another use-after-free:
#[self_referencing]
struct CopyRef {
    #[borrows()]
    the_ref: &'this str,
    later: String,
    #[borrows(later, mut internal)]
    target: &'this mut &'this str,
}

fn main() {
    let mut s = CopyRefBuilder {
        the_ref: "static",
        later: "test".to_string(),
        target_builder: |_, internal| internal,
    }
    .build();

    s.with_mut(|f| {
        **f.target = f.later;
    });
    drop(s); // "later" dropped before "the_ref".
}

This is the field I added to the generated BorrowMutFields struct to get this particular example to compile:
phantom: ::core::marker::PhantomData<(&'this0 mut (), &'this1 mut (), &'this2 mut ())>,


Support create FloatingActionsMenu programmatically

Attributes can't be changed programmatically
Dynamically addButton to FloatingActionsMenu, mButtonsCount doesn't set correctly.

for example:
FloatingActionsMenu menu = new FloatingActionsMenu(getContext());
menu.addButton(new FloatingActionButton(getContext()));
menu.addButton(new FloatingActionButton(getContext()));
menu.addButton(new FloatingActionButton(getContext()));
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.RIGHT | Gravity.BOTTOM);
addView(menu, params);

It support to be 3 buttons when expanded, however, only 2 buttons.
It seems onFinishInflate() not be called when creating FloatingActionsMenu programmatically. Set mButtonsCount's initial value to 1 fix the bug though, but I'm not sure whether it's the best solution.

+1

+1, and please support change FloatingActionsMenu background color programmatically. :)

Incorrect mButtonsCount value was fixed in #228, the request for FAM setters is already tracked at #49