dark mode on fly

Summary
I want to change dark mode of the editor when user clicks on the button.
Screenshots

In the above picture, you can see i have added a dark mode button. I want to change mode from light to dark and dark to light when user click on the button.
Version
latest
Additional context
I am using ReactJS.
export default function App() {
  const [theme, setTheme] = useState("light");
  let darkModeOn = false;

  console.log(darkModeOn,theme)
  const toggleDarkMode=()=>{
    darkModeOn = !darkModeOn;
    setTheme(darkModeOn?"light":"dark");
  }

  return <Editor
    initialValue="# hello react editor world!"
    previewStyle={previewStyle}
    height="400px"
    initialEditType="markdown"
    useCommandShortcut={true}
    theme={theme}

    toolbarItems={[
      ...items, [{
        el: toggleFullScreen(editorRef),
        tooltip: 'Toggle Full Screen'
      }, {
        el: previewStyleButton(),
        tooltip: "Preview Style"
      }, {
        el: darkMode(toggleDarkMode),
        tooltip: "Preview Style"
      }],
      ['scrollSync']
    ]}
  />
}
  />
}

When user click on the button then toggleDarkMode function will be executed. Although, theme state variable is changeing, but UI is not updating.
live
https://codesandbox.io/s/still-night-0feor?file=/src/App.js

We just need to add the class name toastui-editor-dark here. But, doing it by traversing DOM is not good. Is there any way to do it?

Current workaround is
 const toggleDarkMode=()=>{
    let el = document.getElementsByClassName("toastui-editor-defaultUI")[0];
    if(el.classList.contains("toastui-editor-dark"))
      el.classList.remove("toastui-editor-dark");
    else el.classList.add("toastui-editor-dark");
  }

It's working perfectly, but still if there is any other way then let me know.

@ats1999
There are currently no APIs for changing themes.
Your method is correct, and I will think about adding API. Thank you!

Hi, I have a use case for this too, would love to see it added to the API :)

Current workaround is
 const toggleDarkMode=()=>{
    let el = document.getElementsByClassName("toastui-editor-defaultUI")[0];
    if(el.classList.contains("toastui-editor-dark"))
      el.classList.remove("toastui-editor-dark");
    else el.classList.add("toastui-editor-dark");
  }

It's working perfectly, but still if there is any other way then let me know.

The other work around is that you can just add the class to the wrapper dom. Seem like it always overwrite the default. I would love to have direct API for this though.
     <div className={`editor-panel-editor${theme == 'dark' && ' toastui-editor-dark'}`}>
        <Editor
          ref={editorRef}
          initialValue={content}
          previewStyle="vertical"
          height="600px"
          initialEditType="markdown"
          useCommandShortcut={true}
          plugins={[[codeSyntaxHighlight, { highlighter: Prism }]]}
        />
      </div>

Would love to see this feature too!

I would like a vote for this feature as well, for what it's worth. 🙏

+1


Configure Renovate

Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.
🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.

Detected Package Files

.circleci/config.yml (circleci)
example/ios/Podfile (cocoapods)
ios/Podfile (cocoapods)
android/gradle.properties (gradle)
android/build.gradle (gradle)
example/android/gradle.properties (gradle)
example/android/settings.gradle (gradle)
example/android/build.gradle (gradle)
example/android/app/build.gradle (gradle)
android/gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)
example/android/gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)
example/package.json (npm)
package.json (npm)

What to Expect
With your current configuration, Renovate will create 25 Pull Requests:

Update dependency gradle to v6.9.2

Schedule: ["at any time"]
Branch name: renovate/gradle-6.x
Merge into: master
Upgrade gradle to 6.9.2

Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.3.3

Schedule: ["at any time"]
Branch name: renovate/org.jetbrains.kotlinx-kotlinx-serialization-json-1.x
Merge into: master
Upgrade org.jetbrains.kotlinx:kotlinx-serialization-json to 1.3.3

Update FLIPPER_VERSION to v0.147.0

Schedule: ["at any time"]
Branch name: renovate/flipper_version
Merge into: master
Upgrade com.facebook.flipper:flipper-fresco-plugin to 0.147.0
Upgrade com.facebook.flipper:flipper-network-plugin to 0.147.0
Upgrade com.facebook.flipper:flipper to 0.147.0

Update dependency axios to ^0.27.0

Schedule: ["at any time"]
Branch name: renovate/axios-0.x
Merge into: master
Upgrade axios to ^0.27.0

Update dependency com.android.tools.build:gradle to v4.2.2

Schedule: ["at any time"]
Branch name: renovate/com.android.tools.build-gradle-4.x
Merge into: master
Upgrade com.android.tools.build:gradle to 4.2.2

Update dependency metro-react-native-babel-preset to ^0.71.0

Schedule: ["at any time"]
Branch name: renovate/metro-react-native-babel-preset-0.x
Merge into: master
Upgrade metro-react-native-babel-preset to ^0.71.0

Update dependency react to v16.14.0

Schedule: ["at any time"]
Branch name: renovate/react-16.x
Merge into: master
Upgrade react to 16.14.0

Update dependency react-native to v0.68.2

Schedule: ["at any time"]
Branch name: renovate/react-native-0.x
Merge into: master
Upgrade react-native to 0.68.2
Upgrade @types/react-native to 0.67.7
Upgrade @types/react-native to ^0.67.0

Update dependency react-native-builder-bob to ^0.18.0

Schedule: ["at any time"]
Branch name: renovate/react-native-builder-bob-0.x
Merge into: master
Upgrade react-native-builder-bob to ^0.18.0

Update circleci/node Docker tag to v17

Schedule: ["at any time"]
Branch name: renovate/circleci-node-17.x
Merge into: master
Upgrade circleci/node to 17

Update dependency @commitlint/config-conventional to v17

Schedule: ["at any time"]
Branch name: renovate/commitlint-config-conventional-17.x
Merge into: master
Upgrade @commitlint/config-conventional to ^17.0.0

Update dependency @react-native-community/eslint-config to v3

Schedule: ["at any time"]
Branch name: renovate/react-native-community-eslint-config-3.x
Merge into: master
Upgrade @react-native-community/eslint-config to ^3.0.0

Update dependency @release-it/conventional-changelog to v5

Schedule: ["at any time"]
Branch name: renovate/release-it-conventional-changelog-5.x
Merge into: master
Upgrade @release-it/conventional-changelog to ^5.0.0

Update dependency @types/jest to v27

Schedule: ["at any time"]
Branch name: renovate/jest-27.x
Merge into: master
Upgrade @types/jest to ^27.0.0

Update dependency com.android.tools.build:gradle to v7

Schedule: ["at any time"]
Branch name: renovate/com.android.tools.build-gradle-7.x
Merge into: master
Upgrade com.android.tools.build:gradle to 7.2.1

Update dependency commitlint to v17

Schedule: ["at any time"]
Branch name: renovate/commitlint-17.x
Merge into: master
Upgrade commitlint to ^17.0.0

Update dependency eslint to v8

Schedule: ["at any time"]
Branch name: renovate/eslint-8.x
Merge into: master
Upgrade eslint to ^8.0.0

Update dependency eslint-config-prettier to v8

Schedule: ["at any time"]
Branch name: renovate/eslint-config-prettier-8.x
Merge into: master
Upgrade eslint-config-prettier to ^8.0.0

Update dependency eslint-plugin-prettier to v4

Schedule: ["at any time"]
Branch name: renovate/eslint-plugin-prettier-4.x
Merge into: master
Upgrade eslint-plugin-prettier to ^4.0.0

Update dependency gradle to v7.4.2

Schedule: ["at any time"]
Branch name: renovate/gradle-7.x
Merge into: master
Upgrade gradle to 7.4.2

Update dependency husky to v8

Schedule: ["at any time"]
Branch name: renovate/husky-8.x
Merge into: master
Upgrade husky to ^8.0.0

Update dependency jest to v28

Schedule: ["at any time"]
Branch name: renovate/jest-28.x
Merge into: master
Upgrade jest to ^28.0.0

Update dependency react to v18

Schedule: ["at any time"]
Branch name: renovate/react-18.x
Merge into: master
Upgrade react to 18.1.0
Upgrade @types/react to ^18.0.0

Update dependency react-native-safe-area-context to v4

Schedule: ["at any time"]
Branch name: renovate/react-native-safe-area-context-4.x
Merge into: master
Upgrade react-native-safe-area-context to ^4.0.0

Update dependency release-it to v15

Schedule: ["at any time"]
Branch name: renovate/release-it-15.x
Merge into: master
Upgrade release-it to ^15.0.0

❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section.
If you need any further assistance then you can also request help here.

This PR has been generated by Renovate Bot.

🙏 This was from the cronjob triggering before the other PR merged, please ignore.

Renovate is disabled
Renovate is disabled due to lack of config. If you wish to reenable it, you can either (a) commit a config file to your base branch, or (b) rename this closed PR to trigger a replacement onboarding PR.


Is there anyway to pass one-hot binary vector as input and embed it?

I have a situation where I want to pass 1-hot vectors as input and then embed it into lower dimension.
For example, I have single feature input vector like this:

a =
[0,
1,
0,
2,
3,
3,
]

As one can see, there are three classes and 6 samples, hence it's one-hot encoding will be:

b =
[1 0 0 0,
0 1 0 0,
1 0 0 0,
0 0 1 0,
0 0 0 1,
0 0 0 1
]

I want to pass b as input to the model and then embed it using an embedding layer.
Current embedding seems to only support sequence of categorical values as input and not the one-hot vectors.
In fact, I am able to successfully pass a and get an embedding with something like below:
a =  Input(shape=(1,), dtype='int32', name = 'input1')
em = Embedding(output_dim=3,input_dim=4,input_length=1) (a)

But I cannot see how can I modify this to pass b as input instead of a.
Please let me know if there is any way to work around this.
Thanks

In general, you can only index into tensors with indices.   If you want to embed a binary vector, you could just multiply the embedding matrix by the binary feature vectors.  This will have the same effect. I'm not sure on the difference in performance (though I've always meant to profile this in my own work...).

@braingineer: Thanks  for a quick response. While I understand your idea, I don't think I get it fully. Specifically, I did not understand the part of  multiply the embedding matrix by the binary feature vectors. Do I need to write my own embedding layer for that? Or do you mean it can be done with existing API?
If it is later, can you provide code snippet exemplifying how to do it in above case?
Thanks

Sure.  I'll show a quick example using numpy and then how it's handled in Keras.
In numpy, if you index with a numpy matrix of indices, then you select the rows that the numbers correspond to.
In [48]: embedding1 = np.array([2,2,0])

In [50]: embedding2 = np.array([[0,0,1], [0,0,1], [1,0,0]])
In [57]: a[embedding1]
Out[57]:
array([[6, 7, 8],
       [6, 7, 8],
       [0, 1, 2]])

In [58]: embedding2.dot(a)
Out[58]:
array([[6, 7, 8],
       [6, 7, 8],
       [0, 1, 2]])

In Keras, you can use the Embedding layer, which will do exactly as In[57] shows above.  But if you want to use binary vectors, then you can do as In[58].  This is exactly how the Dense layer behaves.  The following code is from the Dense layer:
    def call(self, x, mask=None):
        return self.activation(K.dot(x, self.W) + self.b)

So, you can see that if you set the activation to be linear and self.b to be 0s, then it will return the same exact thing.
Though, I just noticed something troublesome.  You can't actually set b to None in keras.  Hmm.  This should probably be changed. An easy quick fix is to subclass Dense and override the call function and the setting of the trainable weights.   aka:
class BinaryEmbedding(Dense):
    def build(self, input_shape):
        super(BinaryEmbedding, self).build(input_shape)
        self.trainable_weights = [self.W]

    def call(self, x, mask=None):
        return self.activation(K.dot(x, self.W))

Though, as a by the way, why aren't you able to use integers to do the embeddings?  I've used this type of solution before because I had multi-hots and so could either integer embed and sum over the tensor or binary embed and just do the dot product.  Is there a particular reason you can't use integers?

@braingineer : First, you are awesome. Thanks for great explanation.
I think this should work for me. I will try out and see.
As for the binary embed requirement, following are the reasons:
1.) One another implementation (not based on Keras) internally developed used one-hot binary vectors as input. And so I need to compare something with that implementation.
2.) I am little confused about integer vs binary embed in Keras. Now, that is probably because I was directly trying to work with the provided Embedding Layer. As one can see, if I provide binary input to that layer, it messes up dimensions. So to describe my confusion,
In above my example, if I use embedding layer with a like below:
a =  Input(shape=(1,), dtype='int32', name = 'input1')
em = Embedding(output_dim=3,input_dim=4,input_length=1) (a)

it works fine as now dimension of em will be (None, 1, 3)
But if I provide binary one-hot vector to same layer, it gets very strange:
a =  Input(shape=(4,), dtype='int32', name = 'input1')
em = Embedding(output_dim=3,input_dim=4,input_length=4) (a)

The problem is 2-fold: 1.) Input shape now becomes 4 = input_dim in embed layer and 2.) input_length in Embed layer which is actually meant for sequence length of words (in one training sample) now becomes 4? This kind of messes up whole lot of things.
3.) This is question for you: In integer embed, does the embedding matrix will be  of shape (output_dim, input_dim)?
So if I just plainly use integer embed through provided Embedding layer, should I expect the embedding matrix to be of size (3,4)? And of course, the sample size will be another dimension in tensor.
Again, your answer is very helpful and I will certainly use it for my binary experimentation.
I have couple of more related questions for which I will open another issue. Please provide response to them if you are able to help.
Thanks

Hmm.  Ya, anytime you put a matrix as the indices, it will embed all indices and tack it on as the lack dimension. For example, if you took a (4,3) binary matrix and tried to use it in the embedding I showed above:
In [65]: embedding2 = np.array([[0,0,1], [0,0,1], [1,0,0], [0,1,0]])

In [66]: embedding2.shape
Out[66]: (4, 3)

In [67]: a[embedding2].shape
Out[67]: (4, 3, 3)

## or, to make it even clearer:
In [68]: a = np.arange(15).reshape((3,5))

In [69]: a[embedding2].shape
Out[69]: (4, 3, 5)

Embedding takes two arguments: input_dim and output_dim.  This refers to the rows and columns of the embedding matrix.   Since you are using integers, input_dim also corresponds to the max number - 1 that you will pass in. Aka, think of it like indexing into an array.  the array is 15 long, and so the max integer that will work is 14.
In your above example, if you want to embed integers that can take values 0-3, then the input dim would be 4.   If you wanted to embed them into a space that is of dimension 3, the output dim would be 3.  The input length refers to how many integers you are embedding.   If there is a variable number of integers you are embedding, then you can do thing using masking.
And sure. Just mention me on it so I get pinged.  I kind of randomly select issues to comment on when I'm getting burnt out on coding.
B.

Yes, this makes everything pretty clear. Thanks a lot for this discussion and very helpful explanation.

Since the Dense object has since changed here is a solution using a custom layer:
class OnehotEmbedding(Layer):

    def __init__(self, Nembeddings, **kwargs):
        self.Nembeddings = Nembeddings
        super(OnehotEmbedding, self).__init__(**kwargs)

    def build(self, input_shape):
        # Create a trainable weight variable for this layer.
        self.kernel = self.add_weight(name='kernel',
                                      shape=(input_shape[2], self.Nembeddings),
                                      initializer='uniform',
                                      trainable=True)
        super(OnehotEmbedding, self).build(input_shape)  # Be sure to call this at the end

    def call(self, x):
        return K.dot(x, self.kernel)

    def compute_output_shape(self, input_shape):
        return (input_shape[0], input_shape[1], self.Nembeddings)

The input shape is (batch_size, features, onehot_dimensions) and the output is (batch_size, features, Nembeddings).

Yes, this makes everything pretty clear. Thanks a lot for this discussion and very helpful explanation.

Hi,
I have just started learning Keras and I am facing this same issue and havent really understood the solution, could you please help me understand?
my one hot encoding has 72 features and 83k rows/records
a is of size 83000*72
a =  Input(shape=(72,), dtype='int32', name = 'input1')
em = Embedding(output_dim=20, input_dim=83001 ,input_length=83000) (a)
can you let me know what am i doing incorrect here ?
I would really appriciate any help on this, Thanks!


Struct can't handle Clusterfuck...

Clusterfuck is a blank iOS project that includes every possible extension type, as well as a watch app. If nothing else, this could serve as a stress test for your project migration and generation. There are currently a few issues:

During initial migration, many warnings are printed:
Warning: unrecognised project configuration profile 'app-extension'. Ignoring...
and similar.
During migration, the source folders for each target are named src-<#target_type> and folders are created on disk. This was unexpected to me. I'd expect it to match folder structure on disk. Also, the contents of the folders are very strange. Some contain the actual original source folder, others include source from other targets.
Generating a project using the migrated yml file ultimately fails with the error:
[Xcodeproj] Consistency issue: build setting SDKROOT has multiple values: {"Debug"=>"watchos", "Release"=>"iphoneos"}
That's after several of the same warnings seen during initial migration.

This is all based off of the second commit of Clusterfuck, as it may change in the future.
Thanks for the new tool! 🍻

Wow, that's a great resource @jshier! This will be incredibly useful to add to our integration tests. Thanks for the link!
Yes additional platform support is coming as we work to stabilise the tool and add in a full test suite, currently we're limiting it to macOS and iOS at present, which is why you'll get a lot of warnings about unsupported profiles. The folder naming is purely convention based - we generate prefixed folders to avoid any collisions if you for example migrate to the same directory as the source directory, however this can easily be reverted post-migration.
In terms of the contents of the folders, this is based on what files are attached to what targets at the time of migration. Chances are there are files being shared between multiple targets in that project, which is why you may be getting something you didn't expect. When the migration runs, we inspect every file attached to a target, and copy it to the new folder we generate.
Thanks for the detailed issue, this will be incredibly helpful in narrowing down some of the more obscure migration issues you're seeing.

Glad you like it! I’m in the process of doing some renaming, so you’ll see some churn, but I will eventually have iOS, watchOS, tvOS, and macOS in there, with all of the extension points the platforms offer.

That's awesome! We'll definitely keep an eye on this. Looks like it'll be incredibly useful for us going forward to make sure we don't break anything 🚀

Good little benchmark for Apple Tools in general :)

Added watchOS, tvOS, and macOS. Fair warning: Xcode gets pretty laggy when you have the project file selected.

The following tasks are necessary to add support for all of these targets:

[ ]  Add tvOS platform support

[ ] Add tvOS platform profile

[ ] Add watchOS platform support

[ ] Add watchOS platform profile

Struct is handling this a lot better in 2.0.0, however we still need to add a few more profiles and tvOS support in order to fully handle this 👍

PSA: The project has been renamed Turducken, so if you’ve cloned it you’ll need to update to the new URL.

I'm gonna go ahead and close this and keep following the strategy of supporting the project types struct's users request specifically, mainly to keep the maintenance overhead down.


ISPN-1743, tidy up handling of cache names

yes saw that. No definitely not an urgent change, people still have all they need.. just wondering on the API change.
Merged!


Admin UI design/Color palette and Typography

ArangoDB is a great idea. Market for NoSql database with relation/transaction support is wide open. ArangoDb has a potential to replace Mongodb as a mainstream database. I would like to suggest CSS design refresh for admin ui to give it more professional look. Color palette and typography also need improvements. Please consider using material design guidelines or check rethinkDB  admin ui for a reference.

@hkernbach Semantic-Ui can also be used to create great looking ui. SUI also available for react.

Thanks for your comment. Optimizing look & feel and also updating the underlying JS technologies is on our roadmap. But currently it is not a top priority feature.

I would like to suggest CSS design refresh for admin ui to give it more professional look. Color palette and typography also need improvements.

Do you have examples for 'color palettes' and/or 'typography' ? What exactly do you dislike?

Please check  Rethinkdb admin ui, Semantic-Ui and Material design. Are you using any front-end framework? VueJs is my personal favorite nowadays.

On 04/18/17 19:08, Zafar Ansari wrote:

Please check Rethinkdb admin ui https://www.rethinkdb.com/docs/,
Semantic-Ui https://semantic-ui.com and Material design
https://getmdl.io/components/index.html. Are you using any front-end
framework? VueJs is my personal favorite nowadays.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/arangodb/arangodb/issues/2420#issuecomment-294913204,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEx-Vbwtfer3xyQj30aQcjHLz2-J1igJks5rxO4PgaJpZM4M5kUt.

Hallo Claudius,
wie moechtest du denn mit dem Herren in diesem Punkt umgehen? Vielleicht
nimmst du dich dem besser an.
Gruss,
Willi


Convert build system from Ant to Gradle

While the build system for azkaban/azkaban has been converted to Gradle, azkaban-plugins is still uses Ant.

+1

i intend to do it.


metric: the scheduler and latch duration may not be recorded with the grpc duration

Bug Report

What version of TiKV are you using?

release-6.5.2
What operating system and CPU are you using?

Not matter
Steps to reproduce

When write duration is high in TiKV, it may not always be reflected accurately by the metrics. This can cause confusion regarding the slowness of gRPC duration. For instance, when there are conflicts between write commands, the slowest command may hold the latch for several minutes while other commands cannot be processed on time. As a result, a timeout error would be returned to the KV-client but the related TaskContext could still be held in memory until the waiting latch is released. This leads to confusion about kv-grpc-duration, scheduler-command-duration, and latch-wait-duration.
What did you expect?
All the durations should be observed following the write command or task life time.
What did happened?
The grpc duration is observed but other durations may not be observed in time.

As the latch resources are not released with the time out tasks, the tikv node availability would be impacted, raise the severity to critical.

It's not the cause of tikv stuck, lower the severity to major.

This is a metric related issue or improvement, close the issue by now as the improvement needs to be re-considered.


[MdSelectionList] single selection (radio) option

Bug, feature request, or proposal:
Feature Request
What is the expected behavior?
The ability to specify whether or not the md-selection-list supports multiple value selection. I see a few different implementation options:

Expose a multiple attribute on md-selection-list.

When present render each option as a checkbox, otherwise render as radio buttons.
This would be a breaking change as the current behavior is to use check boxes by default.

Expose a type attribute on md-selection-list.

Possible values (for now) would include checkbox (default) and radio.

Expose more specialized md-list-option components. ex md-list-radio-option.

Behavior of mixing checkbox and radio list options? Would probably be clunky.

What is the current behavior?
md-selection-list always renders each child md-list-option as a checkbox.
What is the use-case or motivation for changing an existing behavior?
MdSelectionList is a good starting point for building generic Q&A style wizards/walkthroughs, but you are immediately limited in control over valid option selections. Having the ability to limit user selection to a single list option, presented using radio buttons, seems like it would be a reasonable extension of current behavior.

I don't understand, why this issue is labeled as "minor".
It's a commonly used building block and shouldn't be hard to implement.
I'd suggest a different implementation though: Multiple value selection by default and single selection on demand (via an attribute, e.g. single). This would be a non-breaking change (contrary to the suggested multiple attribute).

This is an important issue.
However, you can jack the selection handler of an element and just access the list to deselect the other items. You then jack the deselection handler to not allow something to be unselected.

@Kyderman Would you be able to share how to do that? Really appreciate it in advance.

As @Kyderman suggested, this would be the hacky way to achieve the radio-list behavior:
<mat-selection-list (selectionChange)="handleSelection($event)">
...
</mat-selection-list>

handleSelection(event) {
    if (event.option.selected) {
      event.source.deselectAll();
      event.option._setSelected(true);
    }
}

Thanks @gabriellupu , works perfectly fine.
Should be a standard included feature though... it's so basic and useful.

It looks the MDC-based list does support single selection. https://github.com/material-components/material-components-web/tree/master/packages/mdc-list#single-selection-list.
We could support that in our MDC-based implementation of the list. #16255


[Bug]: Terminal is not transparent in VSCode 1.92

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior

Expected Behavior
No response
Steps To Reproduce
No response
Environment
- OS: Darwin arm64 23.5.0
- VSCode: 1.92.0 (Universal)
- Extension: 1.1.35
- Theme: Dark++

Anything else?

I've encountered this as well, @A2L265 has recently made a PR with a configuration change that fixes this:

open the settings file and add "terminal.background": "#00000000" inside "workbench.colorCustomizations".
"workbench.colorCustomizations": {
    "terminal.background": "#00000000"
  }

I'll look into automating this config change.

I can also confirm this.  I used to be able to use:  "terminal.integrated.rendererType": "dom".  However, that is not allowed anymore.
@illixion Please let us know when you have a fix for this.  I would be very grateful!

Thanks, the way can it work as well, and as the below setup can apply all profiles.
  "workbench.colorCustomizations": {
    "terminal.background": "#00000000",
  },
  "workbench.settings.applyToAllProfiles": [
    "workbench.colorCustomizations",
  ]

Just published v1.1.36 which automates these config changes, feel free to reopen if this issue re-appears.


Trouble setting up on Centos 7

I have tried to get this running on Centos 7.  I am currently experiencing this error
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.modules.d/10-oauth2.conf: Cannot load modules/mod_oauth2.so into server: /usr/lib64/liboauth2.so.0: undefined symbol: cjose_jwk_import_json
After installing httpd and configurating my conf file, I have run the following
wget https://github.com/zmartzone/mod_auth_openidc/releases/download/v2.3.0/cjose-0.5.1-1.el7.centos.x86_64.rpm
rpm -iv ~/cjose-0.5.1-1.el7.centos.x86_64.rpm --nodeps
wget https://github.com/zmartzone/liboauth2/releases/download/v<IP_ADDRESS>/liboauth2-<IP_ADDRESS>-1.el7.x86_64.rpm
sudo yum localinstall -y liboauth2-<IP_ADDRESS>-1.el7.x86_64.rpm
wget https://github.com/zmartzone/liboauth2/releases/download/v<IP_ADDRESS>/liboauth2-apache-<IP_ADDRESS>-1.el7.x86_64.rpm
sudo yum localinstall -y liboauth2-apache-<IP_ADDRESS>-1.el7.x86_64.rpm
wget https://github.com/zmartzone/mod_oauth2/releases/download/v3.2.0/mod_oauth2-3.2.0-1.el7.x86_64.rpm
sudo yum localinstall -y mod_oauth2-3.2.0-1.el7.x86_64.rpm
Seeing someone had a similar issue with mod_auth_openidc, this is where I found cjose from. I did not install the 2 jansson libraries but rpm -qa shows me they are already installed and the same version you referenced.

I've successfully used https://mod-auth-openidc.org/download/cjose-<IP_ADDRESS>-1.el7.x86_64.rpm on my Docker Centos 7 instances, can you try that?

I've successfully used https://mod-auth-openidc.org/download/cjose-<IP_ADDRESS>-1.el7.x86_64.rpm on my Docker Centos 7 instances, can you try that?

Thanks!  That seems to have fixed the cjose error. Sorry I didn't check to see if there was a newer version of the library.

Thanks!  That seems to have fixed the cjose error. Sorry I didn't check to see if there was a newer version of the library.

You mention docker, do you have any scripts that show how to run this in docker? I've spent some time trying to add it on to httpd:2.4 and facing a growing number of imports I'm needing to pull in.

You mention docker, do you have any scripts that show how to run this in docker?  I was able to get this to run, though I did not think ahead that this image would be ~1.4GB, Do have you, or do you think that one could easily apply your mod_oauth2 to the standard httpd:2.4  or httpd:2.4-alpine image?
I'm still working on my understanding of docker and building upon existing images.

As always thank you for the quick response. I was able to get this to run, though I did not think ahead that this image would be ~1.4GB, Do have you, or do you think that one could easily apply your mod_oauth2 to the standard httpd:2.4  or httpd:2.4-alpine image?
I'm still working on my understanding of docker and building upon existing images.

absolutely, people have done this before https://github.com/zmartzone/mod_auth_openidc/blob/master/Dockerfile-alpine

absolutely, people have done this before https://github.com/zmartzone/mod_auth_openidc/blob/master/Dockerfile-alpine


Updated Coursera

Coursera now has a "Delete Account" button on the "Account Settings" page

Thank you for your contribution!


create If_n_isIn_fibonnaci.cpp

:warning: This is a Pull Request Template :warning:

Check out all the things you've done by placing an *x*\ within the square braces.

Proposed Changes

[x] I've forked the repository.
[x] I've created a branch and made my changes in it.
[x] I've read the CODE OF CONDUCT and abide to it.
[x] I've read the CONTRIBUTING.md
[x] I understand opening a PULL REQUEST doesn't mean it will be merged for sure.

Just changed file location


New subcluster is added incorrectly

Hello,
I am facing an issue when trying to add a subcluster to a running database.
Operator version: 1.10.1
Vertica version: 11.0.2-18
Here is my CR definition:
apiVersion: vertica.com/v1beta1
kind: VerticaDB
metadata:
  name: xxx
spec:
  autoRestartVertica: true
  communal:
    credentialSecret: gcs-creds
    endpoint: ""
    path: gs://xxx/
    region: US-WEST1
  dbName: xxx
  image: gcr.io/xxx/vertica:11.0.2-18
  imagePullPolicy: Always
  initPolicy: Revive
  kSafety: "1"
  licenseSecret: vertica-license
  local:
    catalogPath: /var/lib/verticadb/catalog
    dataPath: /var/lib/verticadb
    depotPath: /var/lib/verticadb/depot
    requestSize: 65536Mi
    storageClass: ssd
  reviveOrder:
  - podCount: 6
    subclusterIndex: 0
  shardCount: 6
  subclusters:
  - affinity: {}
    isPrimary: true
    name: default
    resources:
      requests:
        cpu: 1
        memory: 4Gi
      limits:
        cpu: 4
        memory: 16Gi
    size: 6
    serviceType: LoadBalancer
    nodeSelector:
      node_pool: pool-sd-d-xxx-0
  - affinity: {}
    isPrimary: false
    name: ext
    resources:
      requests:
        cpu: 1
        memory: 4Gi
      limits:
        cpu: 4
        memory: 16Gi
    size: 3
    nodeSelector:
      node_pool: pool-sd-d-xxx-0
  superuserPasswordSecret: xxx-su-passwd
  temporarySubclusterRouting:
    template:
      affinity: {}
      isPrimary: false
      name: ""
      resources: {}
      size: 0
  upgradePolicy: ""

I'm trying to add a 3-node subcluster ext. The pods are created, and I see db_add_subcluster and db_add_node called successfully:
2023-03-16T23:25:50.854Z        INFO    controllers.VerticaDB   ExecInPod entry {"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-default-0", "command": "sudo --preserve-env su dbadmin -- /opt/vertica/bin/admintools -t db_add_subcluster --database xxx --subcluster ext --password ******* "}
2023-03-16T23:25:53.716Z        INFO    controllers.VerticaDB   ExecInPod stream        {"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-default-0", "err": null, "stdout": "Creating new Secondary subcluster 'ext'\nSubcluster added to xxx successfully.\n", "stderr": ""}
2023-03-16T23:25:53.717Z        DEBUG   events  Added new subcluster 'ext'      {"type": "Normal", "object": {"kind":"VerticaDB","namespace":"verticadb","name":"xxx","uid":"edbeb5f2-1795-469d-98f2-44acc8317c80","apiVersion":"vertica.com/v1beta1","resourceVersion":"390098819"}, "reason": "SubclusterAdded"}
...
2023-03-16T23:27:56.732Z        INFO    controllers.VerticaDB   Event logging   {"eventtype": "Normal", "reason": "AddNodeStart", "message": "Calling admintools -t db_add_node for pod(s) xxx-ext-0, xxx-ext-1, xxx-ext-2"}
2023-03-16T23:27:56.732Z        DEBUG   events  Calling admintools -t db_add_node for pod(s) xxx-ext-0, xxx-ext-1, xxx-ext-2      {"type": "Normal", "object": {"kind":"VerticaDB","namespace":"verticadb","name":"xxx","uid":"edbeb5f2-1795-469d-98f2-44acc8317c80","apiVersion":"vertica.com/v1beta1","resourceVersion":"390100980"}, "reason": "AddNodeStart"}
2023-03-16T23:27:56.733Z        INFO    controllers.VerticaDB   ExecInPod entry {"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-default-0", "command": "sudo --preserve-env su dbadmin -- /opt/vertica/bin/admintools -t db_add_node --hosts xxx-ext-0.xxx,xxx-ext-1.xxx,xxx-ext-2.xxx --database xxx --subcluster ext --noprompt --password ******* "}
...
2023-03-16T23:28:42.287Z        INFO    controllers.VerticaDB   Event logging   {"eventtype": "Normal", "reason": "AddNodeSucceeded", "message": "Successfully called admintools -t db_add_node and it took 45.555033754s"}
...
2023-03-16T23:28:42.287Z        DEBUG   events  Successfully called admintools -t db_add_node and it took 45.555033754s              {"type": "Normal", "object": {"kind":"VerticaDB","namespace":"verticadb","name":"xxx","uid":"edbeb5f2-1795-469d-98f2-44acc8317c80","apiVersion":"vertica.com/v1beta1","resourceVersion":"390100980"}, "reason": "AddNodeSucceeded"}

However, new pods never become healthy. I queried the database and saw the subcluster and nodes added, but no shard subscriptions for them. After I called SELECT REBALANCE_SHARDS('ext') manually, they came up and began to work normally. It looks like this step was omitted for some reason.

The operator has a reconcile action to run the rebalance. You will see that action start with a message like this:
2023-03-16T11:08:31.699Z    INFO    controllers.VerticaDB   starting actor  {"verticadb": "spilly/v", "name": "*vdb.RebalanceShardsReconciler"}

If it does any rebalance, then you will see the sql it runs. However, I'm guessing this didn't happen in your case. It will only do the rebalance based on the subscription count that it gathers earlier. You will see a message like this:
2023-03-16T11:08:31.165Z    INFO    controllers.VerticaDB   ExecInPod entry {"verticadb": "spilly/v", "pod": "spilly/v-sc-0", "command": "vsql -tAc select count(*) from v_catalog.node_subscriptions where node_name = 'v_vertdb_node0001' and shard_name != 'replica' "}
2023-03-16T11:08:31.225Z    INFO    controllers.VerticaDB   ExecInPod stream    {"verticadb": "spilly/v", "pod": "spilly/v-sc-0", "err": null, "stdout": "6
", "stderr": ""}

Do you see anything like the above for your newly added nodes?

Thank you! Yes, there are such messages:
2023-03-16T23:28:42.498Z        INFO    controllers.VerticaDB   ExecInPod entry {"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-default-0", "command": "vsql --password ******* -tAc select count(*) from v_catalog.node_subscriptions where node_name = 'v_xxx_node0001' and shard_name != 'replica' "}
2023-03-16T23:28:42.571Z        INFO    controllers.VerticaDB   ExecInPod stream        {"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-default-0", "err": null, "stdout": "2\n", "stderr": ""}
2023-03-16T23:28:45.323Z        INFO    controllers.VerticaDB   starting actor  {"verticadb": "verticadb/xxx", "name": "*vdb.RebalanceShardsReconciler"}

However, there are also the following errors in between when the operator is trying to run queries on nodes that are not subscribed to any shards yet (not sure if that matters though):
2023-03-16T23:28:45.149Z	INFO	controllers.VerticaDB	ExecInPod entry	{"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-ext-2", "command": "vsql --password ******* -tAc select n.node_name, node_state, subcluster_oid, is_readonly from nodes as n, subclusters as s where s.node_oid = n.node_id and n.node_name in (select node_name from current_session) "}
2023-03-16T23:28:45.231Z	INFO	controllers.VerticaDB	ExecInPod stream	{"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-ext-2", "err": "command terminated with exit code 1", "stdout": "", "stderr": "ERROR 9099:  Cannot find participating nodes to run the query\n"}
2023-03-16T23:28:45.231Z	INFO	controllers.VerticaDB	ExecInPod entry	{"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-ext-2", "command": "vsql --password ******* -tAc select count(*) from v_catalog.node_subscriptions where node_name = 'v_xxx_node0009' and shard_name != 'replica' "}
2023-03-16T23:28:45.304Z	INFO	controllers.VerticaDB	ExecInPod stream	{"verticadb": "verticadb/xxx", "pod": "verticadb/xxx-ext-2", "err": "command terminated with exit code 1", "stdout": "", "stderr": "ERROR 9099:  Cannot find participating nodes to run the query\n"}

This is reproducible - I deleted the subcluster, then re-added it and saw the same behavior.

Hmm, even with those Cannot find participating nodes to run the query errors, the operator would have left the state for number of shard subscriptions as zero, causing a rebalance to occur. Could you send me the full operator log to my email (matt.spilchen@vertica.com)? I will take a closer look.

Thank you, I've sent the log to your email.

Works now, thank you very much!


[cardiac_rehab] Changed variable name to match the format of other var names in the form

Problem found. Step to reproduce:

create Participant Status form
enter year of birth
save and close
ctrl+F5 --> form goes blank
alternatively,  go to the patient chart and try to open the form --> blank screen

The above problem was already resolved in another PR and merged into dev.


When the dashboard loads, the 'dashboard without configuration' screen appears for a moment.

As shown on this screen recording... dashboard "version": "0.11.1"
Screencast from 02-01-24 12:53:55.webm

Thanks @lu4t - this is a tricky one as until we receive the first ui-config message we don't actually know what to load. There are two conditions whereby this could happen:

The Node-RED instance has no Dashboard nodes configured, and so will never receive a ui-config event
The Dashboard instance hasn't received the config )yet and it's on the way.

Although, thinking out loud, the ui-base node is required to add the /dashboard endpoint in the first place, so in actual fact, we are guaranteed at least one ui-config event.
Given this, I agree with your point, and will change the default state to a "loading" graphic instead.


storage-resize-images: Resize Images Extension incorrectly names files containing "."

[REQUIRED] Step 2: Describe your configuration

Extension name: (storage-resize-images)
Extension version: 0.1.12

[REQUIRED] Step 3: Describe the problem
The resize image extension is incorrectly naming files which are named from a timestamp. The "." in the file name is likely the issue.
Normally files from the extension are automatically named the same with the width/height following.
ex: profilePic  ->  profilePic_148x148
When renaming files which are named from a timestamp, the width/height goes into the middle of the name.
ex: 2020-10-22T15:29:00.736769  ->  2020-10-22T15:29:00_148x148.736769
The outputted file name should be: 2020-10-22T15:29:00.736769_148x148
Steps to reproduce:

Upload a photo using a time stamp (this bug might also occur when a "." is in the file name).
Have Firebase Resize Photo extension enabled to not delete the original file, and save the new resized image under a "thumbnails" directory.
New thumbnail image name will be named incorrectly.

Expected result
A file named: 2020-10-22T15:29:00.736769_148x148
Actual result
A file named: 2020-10-22T15:29:00_148x148.736769
Suggested Fix / Problem
Edit: The problem is that when uploading a file to storage which doesn't contain a file extension in the set name (picture.of.cats versus picture.of.cats.jpg), fileNameWithoutExtension is still called. This results in the the text after the furthest period being detected as the extension, when it is really part of the file name.  Maybe there should be a check before fileNameWithoutExtension to ensure that a there is a valid extension in the file name first.
I assume the extension looks for the first "." in the file name, and names the file without the file type extension. (picture.png would be named picture_148x148).
The code which names the new photo should look for the very last "." when renaming, not the first one.
ex: myPicture.is.named.with.dots.png should -> myPicture.is.named.with.dots_148x148
but instead the extension will name the picture: myPicture_148x148.is.named.with.dots

Hey @augustkimo, I'm struggling to recreate the problem you're encountering. Here's a screenshot using storage-resize-images version 0.1.12 which have the correct file names:

I've also extracted the implementation for creating a filename from the extension and ran it in isolation on Node 8, 10 & 12. It still returns the correct file name.
const path = require('path');
// imitate storage object passed into extension
const object = {
  name:'2020-10-22T15:29:00.736769.jpg'
}

const extractFileNameWithoutExtension = (
  filePath,
  ext
) => {
  return path.basename(filePath, ext);
};

const filePath = object.name; // File path in the bucket.
const fileExtension = path.extname(filePath);
const size = '200x200';
const fileNameWithoutExtension = extractFileNameWithoutExtension(
      filePath,
      fileExtension
    );

const resizedFileName = `${fileNameWithoutExtension}_${size}${fileExtension}`;

console.log(resizedFileName);

Not sure how this is happening to your file names. If there are any other instructions for reproducing, I'd be happy to help.

Hi @russellwheatley, thanks for looking into this. Not a major bug as client side file name can easily be changed but thought I'd still report it.
I am using Node v12.16.3
I think there are two difference between our uploads:

In storage my file names don't show the extension by default. I don't remember/know if this is a optional setting, but I don't remember setting this. (For you file name is: picture.jpg, while for me it's just named: picture)
Since what I said in point 1 I think extractFileNameWithoutExtension is running after Storage has already removed the extension from the file name.

Here is the code I am using with Flutter with firebase_storage: ^3.1.6:
_uploadAdditionalFiles(uid, image) async {
    //String imageName = DateTime.now().toIso8601String();
    //imageName = imageName.replaceAll(".", "");

    String imageName = "cats.with.full.stops";
    StorageReference storageReference = FirebaseStorage.instance.ref().child('profiles/$uid/photos/additional/$imageName');
    StorageUploadTask uploadTask = storageReference.putFile(image);
    await uploadTask.onComplete;
    storageReference.getDownloadURL().then((fileURL) {
      setState(() {
        additionalPhotoUrls.add(fileURL);
      });
    });
  }

Hey @russellwheatley, just to make sure I understand, is this marked as blocked because it is waiting on #479?

@jhuleatt yes, I thought it was worth waiting until that PR and its increased test coverage was merged first. I'm not sure if that's the appropriate way to use the "blocked" column 😅

Yep, that works, just making sure! I've merged #479. I've also added this to this week's milestone, but we can take it off if it isn't ready.


Mouse interaction

The backend recently gained some mouse functionality, so this is now possible.

Mouse clicks done. Drag-and-drop remains.

Resolved.


Recursive Parse to have Fill String Value

Hey,
When using Recursive Parsing there is an issue that if the input list of strings doesn't have a variable it just skips to the next string in the list and checks. Can you please add a feature where if in the list of strings there isn't a matching variable it would use a Fillstring variable to fill its placeholder and output the same size of list as input
Input:
Rawlist( ListOfStrings) = [{device=device1,otheruselessdata},{device=device2, Device_Model=ModelofDevice2, otheruselessdata}
Functions:
2 parsing functions are used, one parses device name and the other parses Model but every device doesn't necessarily have a model attribute so this screws up the final list
Output:
devname (ListOfStrings) = [Device1, Device2]
devedition (ListOfStrings) = [ModelofDevice2]
Final List
list (ListOfStrings) = [Device1|Device_ModelofDevice2  ,   Device2|NULL

You can use the Zip function, it does exactly this.


chore(tvm_utility): remove tvm_utility package as it is no longer used

Description
The tvm_utility is no longer used.
Related links
Parent Issue:

https://github.com/autowarefoundation/autoware.universe/pull/9241#issuecomment-2457417234

How was this PR tested?
Notes for reviewers
None.
Interface changes
None.

Effects on system behavior
None.

@ambroise-arm good catch. I've also submitted https://github.com/autowarefoundation/autoware/pull/5427 to remove those artifacts.


PaidLevelDomain code doesn't handle newer suffixes properly

Currently the PaidLevelDomain code has its own list of country codes, etc. In reality it should leverage the EffectiveTldFinder class, and add one more piece from the hostname to whatever that returns.
It will still likely need special casing for IP addresses, punycode-encoded URLs, etc but this would be more correct than what we've got currently.

For example, this will fail:
assertEquals("fi.com", PaidLevelDomain.getPLD("www.fi.com"));

Done


Add Connectors using confluent-hub

Add a module to run confluent-hub-install {{ item }} with a list of Confluent Hub items.
kafka:
  connect:
    distributed:
      confluent_hub_packages:
        - debezium/debezium-connector-mysql:latest

https://docs.ansible.com/ansible/2.6/dev_guide/developing_modules_general.html

Solved by #228


Implement AWS-recommended mods to LZ

Describe the issue
We have had a LZ2 review from Andy Fase and there are some items we wish to change on LZ2.  Initially we intended for Andy to do the work but due to procurement delays we will likely have to do the work ourselves.
Which Sprint Priority is this issue related to?
The 'Milestone' should clearly list Sprint Priorities - which one is this issue related to?
Additional context

This is not the IP Range work, this is the LZ2 review

Definition of done

The majority of the changes are config changes that need to be done in the repo
There is an additional piece that needs to be scripted, and added as the last step of an SEA LZ upgrade process because the upgrade will clobber it.  We also need to ask the SEA maintainers to include this as a part of SEA so we can avoid custom steps.
[PO to provide more detail]

Not relevant anymore


NullPointerException in MyGcmListenerService

When the message is received from the server, the message is in a bundle which is converted to JSONObject. This process is creating a NullPointerException.
Instead of creating a JSONObject, we can extract the data directly from the the Bundle.

i can fix it,  let me know the file where the .java file is given, it occurs due to searching or asking object in an array (for example)
which is not stored in the array, we need to look for the logic and find an error


Make iOS delegates opt-in

Fixes https://github.com/tensorflow/tensorflow/issues/39737

Added some invocation examples as comments, lmk if you had somewhere else in mind!

I'll actually have to add another example after https://github.com/tensorflow/tensorflow/pull/38956 merges

Thanks again for your help! Changes look good to me.
Will let @teijeong take a final pass, when he has a chance.

Have you thought about this issue?

This is definitely a good callout.

How is your team going to handle this situation?

After a few years of using bazel we have found there is absolutely no way to be successful without a significant amount of configuration in a root .bazelrc file, so I didn't even consider this as an issue since I assume any significantly complex iOS application will have to have the same. If that's true the burden of folks including that for their entire team would be very low (this is what we would do if we were planning on using the delegates, we actually want the codepath with none of them at least for now)

Do you have better suggestions for the app developers wanting to use the TensorFlowLite swift library?

Off the top of my head I think we have 2 options:

Switch to the blacklist approach. In this case you'd have the same issue, but with reverse defines, but maybe this would be good enough
Create a new swift_library target that is virtually a duplicate of the current one except with none of the select() statements, so folks could depend on that directly for "all" the delegates. This would also only partially solve the issue if you wanted only 1 of them.

In general I think this just brings up a place where bazel lacks some configurability, and flags are our only option 😢

After a few years of using bazel we have found there is absolutely no way to be successful without a significant amount of configuration in a root .bazelrc file

This is a fair point, and I agree that lots of projects require additional parameters anyways.
My concern was also related to how our internal CI system works. There are existing apps already depending on the TensorFlowLite Swift library, and because some of them are using Metal delegate, those builds would probably break if we submitted this PR as is. There are ways to provide custom build flags for each project, but it's a bit more involved than it sounds.

Switch to the blacklist approach. In this case you'd have the same issue, but with reverse defines, but maybe this would be good enough

Yes, I would actually much prefer an opt-out model, because it could still give you options to easily exclude unnecessary delegates, and when we don't really care about the project size, the default configuration would suffice. I believe this would be also good enough to meet your needs.
More specifically, we could rename the define variables to be use_foo_delegate -> exclude_foo_delegate, and reverse the select conditions.

Yes, I would actually much prefer an opt-out model, because it could still give you options to easily exclude unnecessary delegates, and when we don't really care about the project size, the default configuration would suffice. I believe this would be also good enough to meet your needs.

The current CocoaPods approach is to opt-in, where developers explicitly list in their Podfiles which delegates they want to include. Do we want Bazel to match that workflow?

There are existing apps already depending on the TensorFlow Lite Swift library, and because some of them are using Metal delegate, those builds would probably break if we submitted this PR as is.

Agreed that this would need to be communicated to existing teams, but you can think about the reverse where that each time we add a new delegate to TensorFlowLite Swift library, teams will need to decide if they want to increase their binary size for one or more delegates that they don't plan to use. Opt-in approach breaks existing teams currently using Metal delegation, but hopefully long term will provide them with the flexibility to add only the delegates they plan to use and avoid unnecessary binary increases.
If the plan is to add more delegates in the future, I think opt-in for both CocoaPods and Bazel provides the most flexibility for consumers of the TensorFlow Lite Swift library.

@tristane0 Okay, that makes sense to me. I'm convinced enough to proceed with opt-in approach. 😀

@keith looks like this change will break the existing unit tests for MetalDelegate
We may need to exclude MetalDelegateTests.swift and do the selects here as well:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/experimental/swift/BUILD.apple#L70
and add the use_metal_delegate=1 define to where we invoke bazel test //tensorflow/lite/experimental/swift/...
Any other options?

I pushed what I think is the other option, which might be a bit nicer overall, lmk what you think or I can revert it and go down the other path. I think it kinda depends on how much of a pain it will be to keep the second one in sync, vs how much of a pain it'll be to run CI multiple times with different defines. I wish there was a way to force the defines on from the swift_library level or select on features but I can't think of another way to configure it.

I pushed what I think is the other option, which might be a bit nicer overall, lmk what you think or I can revert it and go down the other path. I think it kinda depends on how much of a pain it will be to keep the second one in sync, vs how much of a pain it'll be to run CI multiple times with different defines. I wish there was a way to force the defines on from the swift_library level or select on features but I can't think of another way to configure it.

Thank you @keith! This was one of the options we were discussing yesterday and we agreed that it was a simpler approach than dealing with the selects for the Tests library. I am fine with moving forward with this approach.
Would it be possible to mark the "all delegates" swift_library as testonly = 1? I think this would also require updating the test app targets to include that as well? I would also be ok with having test app just depend on :TensorFlowLite as it doesn't reference any of the delegates and not sure if there are any plans to do so since TFLite has existing example apps that already demonstrate Metal delegate usage.
@yyoon to confirm and approve.

Updated!

Updated!

Looks like we need to update the :TestsLibrary to depend on the "all delegates" target; otherwise, LGTM. Thank you!

Sorry I swapped the wrong one, updated

@keith can you please check sanity errors here

thanks, ran buildifier on it locally


Explicit BigSpaces

Changes the design of the plugin to work with multiple, independent high-precision hierarchies at the root with the BigSpace component at the root of each of these hierarchies.
Closes #17
Closes #19
Closes #21

Open issues:

Doesn't support low precision spatial entities that are direct children of reference frames, they must be children of a high-precision (gridcell) entity. Not quite sure if that is a good or a bad thing. It isn't strictly necessary, but it does seem like it could prevent some footguns. I imagine this will most often be used when spawning in a scene - requiring you add a GridCell on the scene root is easy, and will prevent precision artifacts when you start moving it around the reference frame.
Need to finish the split screen example
Revisit the naming. Not set on what I have right now, but I generally feel like it is better than on main.

Want to make the distinction between bevy's low-precision spatial bundle, and big-space's high-precision bundle. They can be thought of very similarly.
Each "BigSpace" hierarchy at the root is completely independent. Want to make that more clear.

It seems like we will need a better way to query objects in specific trees. I'd like to avoid adding another generic parameter though.
Spawning code often needs access to the current reference frame, but that is not super easy to get to. It would be handy if there was an EntityCommand extension to add children, and be given the parent reference frame, so you can do things like spawning entities with double precision.

Not actionable right now, but I can't stop thinking that this is pretty close to being a spatial acceleration structure. Hash the GridCells and stick them in a hashmap to get the entities, and you now have a fast spatial lookup within each reference frame. This would also help solve issue 4, because you could query a much smaller set of entities, and they would be guaranteed to be local.

Split screen working:
https://github.com/aevyrie/big_space/assets/2632925/b6310b8d-e0b4-46c1-8f25-872d21cbd6f5


新版本的   repos 也加到本地了

[ERROR] No plugin found for prefix 'cat' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/xubihui/.m2/repository), central (http://repo1.maven.org/maven2), unidal.releases (http://cat.meituan.com/nexus/content/repositories/releases/)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

环境问题你参考安装文档更新下pom


⚠ Bofrost.lu has degraded performance

In afaefbd, Bofrost.lu (https://www.bofrost.lu) experienced degraded performance:

HTTP code: 200
Response time: 859 ms

Resolved: Bofrost.lu performance has improved in 8aa6d59 after 7 minutes.


dif/2 with unexpected instantiation error II

?- dif(A,B),B=C*A,B=[]*[].
   error(instantiation_error,atomic), unexpected.

A = [], B = []*[], C = [].
?-

Narrowed down to an optimization problem...
$ tpl
?- dif(A,B),B=CA,B=[][].
throw(error(instantiation_error,atomic)).
?-
$ tpl -O0
?- dif(A,B),B=CA,B=[][].
A = [], B = []*[], C = [].
?-

(Note to self: do not use operator * in examples, when / is just as good.)


Better resource manager

Summary
Include a summary of major changes in bullet points:

Fix 1: Fix the bug that the task in REQUESTING_RESOURCES status cannot be canceled.
Fix 2: Clean up the code. Basically remove some while loop that waits for status update. It is because the MongoDB update operation itself is blocking. So, there is no need to wait for the status change after you do update_status.
Fix 3: add canceling REQUESTING_RESOURCES task into unittest.

Additional dependencies introduced (if any)

List all new dependencies needed and justify why. While adding dependencies that bring
significantly useful functionality is perfectly fine, adding ones that add trivial
functionality, e.g., to use one single easily implementable function, is frowned upon.
Provide a justification why that dependency is needed. Especially frowned upon are
circular dependencies.

TODO (if any)
If this is a work-in-progress, write something about what else needs to be done.

Feature 1 supports A, but not B.

Checklist
Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request
title.
Before a pull request can be merged, the following items must be checked:

[ ] Code is in the standard Python style.
The easiest way to handle this is to run the following in the correct sequence on
your local machine. Start with running black on your new code. This will
automatically reformat your code to PEP8 conventions and removes most issues. Then run
pycodestyle, followed by flake8.
[ ] Docstrings have been added in theNumpy docstring format.
Run pydocstyle on your code.
[ ] Type annotations are highly encouraged. Run mypy to
type check your code.
[ ] Tests have been added for any new functionality or bug fixes.
[ ] All linting and tests pass.

Note that the CI system will run all the above checks. But it will be much more
efficient if you already fix most errors prior to submitting the PR. It is highly
recommended that you use the pre-commit hook provided in the repository. Simply
cp pre-commit .git/hooks and a check will be run prior to allowing commits.

No need for reviewing. It is mostly based on the pull request #65. We can start to merge this after the previous one is merged.

The code is ready for review.

I think it is overlap a lot with the previous pull request. Will close this one and open a new one.


connect_ws and aconnect_ws always raise WebSocketNetworkError when keepalive_ping_timeout_seconds + keepalive_ping_interval_seconds

connect_ws and aconnect_ws always raise WebSocketNetworkError when keepalive_ping_timeout_seconds + keepalive_ping_interval_seconds (Actual WS is working normally)

To Reproduce
try:
    with Client(base_url=url, params={'token': token}) as client:
        with connect_ws('/traffic', client,
                        keepalive_ping_timeout_seconds=3,
                        keepalive_ping_interval_seconds=4
                        ) as ws:
            n = 0
            start = time.time()
            while True:
                n += 1
                print(n, ws.receive_json())
except WebSocketNetworkError:
    print('WebSocketNetworkError, total time:', time.time() - start)

Expected behavior
The server sends traffic once per second, which is stable and permanent, and should not trigger errors or timeouts
Configuration

Python version: 3.11.4
httpx-ws version: 0.4.1
httpx version: 0.24.1

Additional context
None

How and with what libraries is your WebSocket server implemented? It looks to me that it doesn't answer the ping request. The client expects a specific answer to its ping, it doesn't consider other messages.

Thank you very much for your reply.
The service is clash premium, and I'll check to see if it responds to ping requests.
My current solution is to set keepalive_ping_timeout_seconds to None.


fix: remove baseURL from extracted links

🔗 Linked issue
resolves https://github.com/nuxt/content/issues/1252
❓ Type of change

[ ] 📖 Documentation (updates to the documentation or readme)
[x] 🐞 Bug fix (a non-breaking change that fixes an issue)
[ ] 👌 Enhancement (improving an existing functionality like performance)
[ ] ✨ New feature (a non-breaking change that adds functionality)
[ ] ⚠ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description
When following links with a baseURL set, we were following them directly, resulting in double-prefix of baseURL.
📝 Checklist

[x] I have linked an issue or discussion.
[ ] I have updated the documentation accordingly.

Do you mind creating an issue with minimum (nitro) reproduction? I believe base URL has to be fetched as-is when configured but might be wrong.

We are adding the baseURL here:
https://github.com/unjs/nitropack/blob/main/src/prerender.ts#L55
So if (in the Nitro response) there is a URL with that baseURL already present (as would be required for routing to work) then it will add the baseURL again at the point of generating the route.


Return empty ResponseBody in FileIO for empty files

The FileIO methods for loading files create byte ranges based on the file's size. If the file is empty, the range cannot be created and the app exits with the following error:
Fatal error: Range requires lowerBound <= upperBound

This pull request adds a check to ensure the filesize is > 0 and just returns an empty ResponseBody otherwise.

Thank you. I'll look to get a release out tomorrow with these fixes.


Make modal reusuable by creating a reusable notification modal

Hey team! Please add your planning poker estimate with Zenhub @saravanpa-aot @tiagograf-AOT @VineetBala-AOT


Can't delete a Slack I have logged in from plaidchat menu

Hi,
I would like to be able to delete a Slack I have logged in from the plaidchat menu, but can't figure out how to do it.
I am very sorry of that is a RTFM question. I read it, I swear.
If some code is required, I am willing to try, although I'll need some help to get started.
All the best !
BTW : Great software ! I use it all the time

To "delete" a team, logging out should do the trick. It's been a while since I have used Slack but if it still remembers the team on the log in screen, then there should be a way to remove the team from that as well.

Hmmm... for me it does not. Logging out does but the "logged out Slack" below in the menu, but it doesn't remove the Slack entry from the menu

There is definitely a button somewhere on that login screen where Slack asks you to select a team but I am fairly out of context. Can you look some more?

Doing it :)

This is what I see. Below is the footer of the website. In the menu, only zoom in/out and developper's tool

Hmm, wierd. I tried browsing it myself and couldn't find anything. I'm sure there's something but not sure where. It definitely wouldn't be a custom integration since we use Slack's website so they would have to have a similar setup for browsers.
I'm going to re-open the issue but I don't have time to dig in further =/

Thank you for your help already.
As far as I know, Slack's website doesn't allow multiple slack per Window, so I believe this is a custom feature of the app

We are using multiple iframes to load multiple windows but we are scraping the login page/Slack application for team info ;)


feat: prioritized mempool

This PR brings prioritized mempool from Tendermint v0.34.20 to Optimint.
mempool was copied from tendermint v0.34.20
It was adapted to make it compatible:

tmsync package was removed (sync used instead)
clist copied to mempool/, imports fixed
v0 removed
v1/reactor.go removed

Changes in node, rpc, state packages was caused by changes in mempool
API.
Resolves: #191

Codecov Report

Merging #480 (0e9ab83) into main (30fa397) will increase coverage by 0.99%.
The diff coverage is 80.34%.

@@            Coverage Diff             @@
##             main     #480      +/-   ##
==========================================
+ Coverage   55.15%   56.15%   +0.99%
==========================================
  Files          48       50       +2
  Lines        8802     9237     +435
==========================================
+ Hits         4855     5187     +332
- Misses       3193     3292      +99
- Partials      754      758       +4

Impacted Files
Coverage Δ

mempool/metrics.go
15.51% <10.52%> (-2.44%)
:arrow_down:

rpc/client/client.go
45.94% <50.00%> (ø)

mempool/mempool.go
52.77% <53.33%> (-29.84%)
:arrow_down:

mempool/clist/clist.go
75.00% <75.00%> (ø)

mempool/v1/tx.go
76.31% <76.31%> (ø)

mempool/cache.go
84.21% <84.21%> (ø)

mempool/v1/mempool.go
86.72% <86.72%> (ø)

node/node.go
65.32% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.


GLM-4 and Dify Response Reception Issue

System Info / 系統信息
Ubuntu22.04，RTX 4090
Who can help? / 谁可以帮助到您？
No response
Information / 问题信息

[ ] The official example scripts / 官方的示例脚本
[ ] My own modified scripts / 我自己修改的脚本和任务

Reproduction / 复现过程
When using the GLM-4 openai_api_server, Dify can display a successful model connection, and the local GLM-4 can receive text sent by Dify and generate responses. However, the text generated by GLM-4 cannot be received by Dify.
Expected behavior / 期待表现

I believe this should make a issue to dify and we are using the defualt openai sdk

dify确实用不了啊


Remove duplicate sections for PR in Forks

The section 'Pull request events for forked repositories' was displayed three times by mistake - this commit removes the two duplicate sections.
Why:
Removes duplicate sections to correct the documentation.
Resolves #11212
What's being changed:
Second and Third occurrence of the redundant text have been removed.
Check off the following:

[x] I have reviewed my changes in staging (look for the latest deployment event in your pull request's timeline, then click View deployment).
[x] For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

[ ] This pull request impacts the contribution experience

[ ] I have added the 'writer impact' label
[ ] I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

I'm going to close this PR because the Docs experts at GitHub have got a different fix in mind, and we'll implement that fix internally.

Thanks to both of you for the quick response - glad it's on the radar and no worries about closing the PR!


Output Statistics Facet example uses inputs but this should only be valid on outputs

https://openlineage.io/docs/spec/facets/dataset-facets/output-dataset-facets/output_statistics

Thanks, fixed.


Get contact details (age, email, phone) of contacts without email

Moved here the message @lmatias posted in #2.

Hi GioBonvi
I have your ode running and I thanks for it.
I personalized your code with translation where you indicate.
I noticed that in the code you refer to age notification but after adding the age variable to the line
var body = bodyPrefix + bodyBuilder.join('') + bodySuffix + age;
I get the error "ReferenceError: "age" not defined. (line 157, file "Código")"
Is it possible to do what I want or not?

@lmatias Please open up a new issue instead of jumping on another one which does not concern your problem.

@lmatias I am not sure of what you are actually trying to achieve...
Currently the email notifications you will receive will contain the age of your contacts (given that those contacts have a birthday year) in the body of the email, right next to the contact's name.
The error you receive is specifically caused by the fact that the age variable is not availabel where you put it.
If you remove the  + age part of the line it should all work correctly.

Sorry for my error.
I noticed that age variable is included in the bodyBuilder variable with line push but the age is only displayed if the contact has one email registered.
If the contact don't has email we won't get age, mobile phone or email... 8-(
Is it possible to always have the age, if the birth year exists, in the notification email?

Ok, now I understand.
At the moment what you ask for is actually not possible, because if a contact does not have an email the script cannot load any data about that contact execept for the day of the birthday.
I know this is a feature you and many others would like to see implemented (I would like this as well), so I am planning to work on this, however I have other projects which currently take quite a lot of my time, so I cannot say when this will be implemented.
For now I'm marking this as a bug: I'll let you know with a comment on this issue (which should get you an email notification) when it will be solved.
Thank you for your time and patience!

Ok
Thanks

BTW: I just did a big hack-session today and made lots of changes, refactoring and added features (internationalization by lookup-function, demo translations in Greek, plaintext/html-hybrid email, inserting contact-photos inline, elegant handling of missing contact-fields, '[email this person]' links, configurable emailing of logs, speedup-refactoring, etc). It is all presently dumped into a branch on my forked repo as a single commit, but I'll separate it to meaningful commits soon to make it useful for @GioBonvi to merge/cherrypick the bits he wants. One of the key changes I made was to match the contact by contactId (with the necessary URL template prepended for matching) rather than by contactEmail, which solves this issue (and any similar issue with data missing from other fields too).
Once I open a PR I will mark it as a closer for this issue, but am just mentioning the giant-commit-branch already now, so no-one else wastes time on re-doing the fix.

These are wonderful news!
I have already developed a version which makes use of the contactId, but I am still testing it in private to see if it works 100%.
I am extremely eager to see your improvements @rowanthorpe: this is more than what I hoped to obtain by making this script open source.
Thank you again!

@GioBonvi In terms of just seeing the changes, you can already look at my combined commit here (note that link will disappear when I rebase it later on though, so you can also find the changes via the branch-link I gave in my other message above) but I will soon also split it into its constituent logical parts, because I know that while grokking and refactoring (for my own readability) various stylist preferences of mine crept in, which are different-from & irrelevant-to the actual functional changes you might be interested in, rather than an all-or-nothing commit.

@lmatias The PR from @rowanthorpe is finally merged: the feature you were asking for should be now working.  (Delete all the code and follow the instructions with the new version like the first time)


Font size & Quick font size adjustment

Love the pine_forest_berry theme.
I've just tried setting the Font size to something other than the default, both manually and via "Quick Adjust Font Size" (touchpad), but unfortunately to no avail. However I found no problem at all with other themes, in particular, the Obsidian default one...
Obsidian Version 0.15.9 (installer 0.15.8)
Mac OS X 10.14.6 (Mojave)
Thank you very much for your great work.

Hi galderna!
Sorry for the late reply. I'm having a baby any day now and I'm a little preoccupied with that, but thank you for your feedback and I will get on that, as soon as I have the capacity! In the meantime, if you maybe want to tweak around yourself: I would go about this by just looking at the code of other themes where the Font Size can be adjusted and compare how they wrote it differently. And feel free to share, if you find anything!

Hello, I like this topic very much！！！
I would like to ask whether the problem that the font size cannot be changed has been solved.
Thank you！！

Hello! I really love this theme but I have an issue about that. It doesn´t recognize this command: ctrl + scroll or cmd + scroll.
Thank you!!!

You can remove the lines defining editor font size, and let obsidian use the default ones. This worked for me – the editor adjusts to the font size settings. I don't use reading mode, so I don't know the influence on that.


adaptor buffer leak in system_tests_http2

 self = <system_test.Tester object at 0x7f14328a1d80>

    def teardown(self):
        """Clean up (tear-down, stop or close) objects recorded via cleanup()"""
        self.cleanup_list.reverse()
        errors = []
        for obj in self.cleanup_list:
            try:
                for method in ["teardown", "tearDown", "stop", "close"]:
                    cleanup = getattr(obj, method, None)
                    if cleanup:
                        cleanup()
                        break
            except Exception as exc:
                errors.append(exc)
        if errors:
>           raise RuntimeError("Errors during teardown: \n\n%s" % "\n\n".join([str(e) for e in errors]))
E           RuntimeError: Errors during teardown:
E
E           Process 3349 (name=http2-test-router) error: returned error code -6
E           skrouterd -c http2-test-router.conf -I /home/runner/work/skupper-router/skupper-router/skupper-router/python
E           /__w/skupper-router/skupper-router/skupper-router/build/tests/system_test.dir/tests/system_tests_http2/Http2TestOneEdgeRouter/setUpClass/http2-test-router-58.cmd
E           >>>>
E           ERROR: Aborted due to unexpected alloc pool leak of type 'qd_adaptor_buffer_t'
E           Fatal Python error: Aborted
E
E           Current thread 0x00007fb66ec5c3c0 (most recent call first):
E             <no Python frame>
E           <<<<

/home/runner/work/skupper-router/skupper-router/skupper-router/tests/system_test.py:1036: RuntimeError
---------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------
INFO     proton:_reactor.py:1053 Connecting to Url('amqp://<IP_ADDRESS>:29724')...
INFO     proton:_reactor.py:1091 Connected to <IP_ADDRESS>
---------------------- generated xml file: /__w/skupper-router/skupper-router/skupper-router/build/tests/junitxmls/system_tests_http2.xml ----------------------
=================================================================== short test summary info ====================================================================
ERROR ::Http2TestOneEdgeRouter::test_zzz_http_connector_delete - RuntimeError: Errors during teardown:
=========================================================== 93 passed, 1 error in 282.02s (0:04:42) ============================================================

https://github.com/skupperproject/skupper-router/actions/runs/3135699596/jobs/5091692358#step:29:2140

Duplicate of https://github.com/skupperproject/skupper-router/issues/714


FAILURE Client has not been run ERROR

I am getting this error when trying to log. What is the reason?

Hi myasin59, reading the error message you got, I have to ask you as a first thing: Are you sure that you have ever started your node (with ./concordium-node and filling in the necessary info when prompted)? What is your nodeID and node name?

yes, it has been working for 9 days.Also, the node I set up for the b2
task is getting logs, but it fails.
Name: myasin55
Node ID:  f1e4dd1102609918
concordium-admin<EMAIL_ADDRESS>23 Eki 2020 Cum, 10:27
tarihinde şunu yazdı:

Hi myasin59, reading the error message you got, I have to ask you as a
first thing: Are you sure that you have ever started your node (with
./concordium-node and filling in the necessary info when prompted)? What
is your nodeID and node name?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Concordium/Testnet3-Challenges/issues/945#issuecomment-715063616,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ARNSVBYKSV7HCOA7PXK4BLDSMEV6VANCNFSM4S35KMQQ
.

The log retrieval tool is a bit wasteful with memory at the moment. A new one should be available next week. To debug your issue, I would need the following information

did your node get killed due to, say, running out of disk space, or memory?
can you run docker container list and post the results here?

That should output a CONTAINER ID that you can then use to get the logs via docker logs. If docker container list does not output any container related to concordium then your node is not running.

no problem with storage we have enough space.

And what does docker container inspect concordium-client produce?

client gives this error when I want to run it. also I don't understand what you mean, could be a bit more specific you know.

My question was, if you run docker container inspect concordium-client, what is the result. I don't think I can be more specific than that. There's clearly something unusual about your configuration that is causing these failures.
What user are your running these commands under? Are any of the environment variables XDG_DOCUMENTS_DIR or HOME set?

                    "HostIp": "",
                    "HostPort": "8888"
                }
            ]
        },
        "RestartPolicy": {
            "Name": "no",
            "MaximumRetryCount": 0
        },
        "AutoRemove": false,
        "VolumeDriver": "",
        "VolumesFrom": null,
        "CapAdd": null,
        "CapDrop": null,
        "Capabilities": null,
        "Dns": [],
        "DnsOptions": [],
        "DnsSearch": [],
        "ExtraHosts": null,
        "GroupAdd": null,
        "IpcMode": "private",
        "Cgroup": "",
        "Links": null,
        "OomScoreAdj": 0,
        "PidMode": "",
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "SecurityOpt": null,
        "UTSMode": "",
        "UsernsMode": "",
        "ShmSize": 67108864,
        "Runtime": "runc",
        "ConsoleSize": [
            0,
            0
        ],

c6384808c4318a982c04d3c/diff:/var/lib/docker/overlay2/df245efe8feab3894b9ff0cb28d35254316c7c096a27f600cc768f42a1865a00/diff:/var/lib/docker/overlay2/54a755991a88cc62beab56200694cb16fdbe893dfd0184ca1290b51599213b49/diff:/var/lib/docker/overlay2/c93278140e36f6c6b8c0949cb527f6f7a0a916f4117bc50afa7754509140b44c/diff:/var/lib/docker/overlay2/46f631d70a50d6e0ba516377859c979cf94df26da2aac4dadad14d8015adb489/diff:/var/lib/docker/overlay2/a3b959bd6a10fe0c991df578d9ebe5f53034ef706437cdb4a968bef268ed4609/diff:/var/lib/docker/overlay2/78fa845e5f69c1451f3583c09b5b68e7060805ab233dd0d9b5a5c7cf3f593305/diff:/var/lib/docker/overlay2/6aa97daf47f2ae11ea5e09714a9e150e8b17d0a042c33278686d9bd0c628561f/diff:/var/lib/docker/overlay2/904d15848fcc56bf44a5f16d4549476d98d60456bf040eb744e8e25c88c21f75/diff:/var/lib/docker/overlay2/74488d5c40426ea1bc643f1b83304ecb71f8875d47404a43598220c22778bc91/diff:/var/lib/docker/overlay2/b950373293adab2dc81c9ff855a05fafa67e8603f93cf0390b86e93268df3997/diff:/var/lib/docker/overlay2/deb4e598711b05e0fdc651103af514007e1029fa5d4b37e304c469cf98af8a67/diff:/var/lib/docker/overlay2/6f5dbfc7ba13c4f584bff95c16b789c4728fffd14d7b4ed196b67ef506a50667/diff:/var/lib/docker/overlay2/898262d064fe1f615b7108ba8f808152f29d8e6dd2c03045eee88bf007fbf34e/diff:/var/lib/docker/overlay2/60574ada1cece51dd230007caae81cdae02cc54e6e7989af3c7051972dc43157/diff:/var/lib/docker/overlay2/cecdd4a2425d96fdcc85fed5f513cbf5a65bf2d7af4ba33786b27f35eac6a6f8/diff:/var/lib/docker/overlay2/0d686565b891d027f2b5bd5e20b138d308d4d4e33c37bedf6eb914f96b3a7ebb/diff",
"MergedDir": "/var/lib/docker/overlay2/7f35312999453f78c6f0b8a8e46098baba377e30cb7765b588cb6165bf5e0a6a/merged",
"UpperDir": "/var/lib/docker/overlay2/7f35312999453f78c6f0b8a8e46098baba377e30cb7765b588cb6165bf5e0a6a/diff",
"WorkDir": "/var/lib/docker/overlay2/7f35312999453f78c6f0b8a8e46098baba377e30cb7765b588cb6165bf5e0a6a/work"
},
"Name": "overlay2"
},
],
"8888/tcp": [
{
"HostIp": "<IP_ADDRESS>",
"HostPort": "8888"
}
]
},
"SandboxKey": "/var/run/docker/netns/80afbdf1c61e",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "fe9df201f6886027020642f9bdae051221a015b444c79ef912baa495c3d8389f",
"Gateway": "<IP_ADDRESS>",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "<IP_ADDRESS>",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "5fde9ee1332e47b790f8cb81472cf5afdcef1e4b76189dd6dbb94e199c26ff8b",
"EndpointID": "fe9df201f6886027020642f9bdae051221a015b444c79ef912baa495c3d8389f",
"Gateway": "<IP_ADDRESS>",
"IPAddress": "<IP_ADDRESS>",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]


⚠ Bofrost.gr has degraded performance

In 5625063, Bofrost.gr (https://www.bofrost.gr) experienced degraded performance:

HTTP code: 200
Response time: 4585 ms

Resolved: Bofrost.gr performance has improved in ed039ea after 6 minutes.


[vmim][rbac] Limit VMIMs to cluster admins

Today, any namespace admin can trigger (create) and revoke (delete) live-migrations for VMs defined in his namespace.
Live-migration is a infra level operation that is also used for cluster infra tasks like node drains, cluster rebalancing and upgrades. VM owners are not expected to be interested in managing live-migration with the risk of delaying or compromising cruster infra activities.
Today all the operations on VMIMs are allowed for kubevirt.io:admin clusterrole which is then aggregated to the default user-facing admin clusterrole that is intended to be granted to namespace admins with a RoleBinding defined within his namespace.
Nothing is instead needed for the cluster-admin (super-user) clusterrole that is defined as:
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - '*'

This PR is explicitly removing "write rights" for the kubevirt.io:admin clusterole (same for kubevirt.io:edit) to avoid having them propagated down to namespace admins.
Users with cluster-admin role are not going to be impacted.
An additional kubevirt.io:migrate clusterrole is defined for the convenience of cluster admins that wants to allow some of their users to continue managing live migrations.
What this PR does
Before this PR:
namespace admins (system:admin) can trigger or cancel live migrations for the VMs in their namespaces
After this PR:
only users with cluster-admin or kubevirt.io:migrate roles are allowed to trigger or cancel live migrations

Fixes: https://issues.redhat.com/browse/CNV-52819
Why we need it and why it was done in this way
The following tradeoffs were made:
This is only touching the set of default RBAC rules shipped at install time so it's fully backward compatible in terms of APIs.
An additional specific cluster role is provided for convenience.
The following alternatives were considered:

Converting the VMIM CRD from namespaced to cluster scoped one is a not backward compatible change with an hard transition path
Implementing different Migration priority queues to distinguish system-triggered migrations from user-initiated ones is an alternative option if we really want to have high priority infra/system initiated migrations and low-priority best-effort user initiated ones. On the other side is more complex and we are not really sure we need something like that.

Links to places where the discussion took place:
Special notes for your reviewer
Please refer to: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

[ ] Design: A design document was considered and is present (link) or not required
[X] PR: The PR description is expressive enough and will help future contributors
[X] Code: Write code that humans can understand and Keep it simple
[ ] Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
[ ] Upgrade: Impact of this change on upgrade flows was considered and addressed if required
[X] Testing: New code requires new unit tests. New features and bug fixes require at least on e2e test
[ ] Documentation: A user-guide update was considered and is present (link) or not required. You want a user-guide update if it's a user facing feature / API change.
[ ] Community: Announcement to kubevirt-dev was considered

Release note

Limit VMIMs to cluster admins

Thank you for the PR @tiraboschi. As several features are dependent on migration, for example NIC hotplug, I am concerned that this change will break these features for namespace admins.

I don't think migrations created by virt-controller will be impacted by this.

Thank you for the PR @tiraboschi. As several features are dependent on migration, for example NIC hotplug, I am concerned that this change will break these features for namespace admins.

I don't think migrations created by virt-controller will be impacted by this.

NIC hotplug migration is manually triggered for migration-based hotplug.

@tiraboschi this is great to see, but let's make sure we all agree as this might break the assumption that many users have at this point.
@fossedihelm @xpivarc @jean-edouard @iholder101 @vladikr

Thank you for the PR @tiraboschi. As several features are dependent on migration, for example NIC hotplug, I am concerned that this change will break these features for namespace admins.

I don't think migrations created by virt-controller will be impacted by this.

NIC hotplug migration is manually triggered for migration-based hotplug.

That's surprising, all other hotplugs happen automatically. Why is that?

ank you for the PR @tiraboschi. As several features are dependent on migration, for example NIC hotplug, I am concerned that this change will break these features for namespace admins.

I don't think migrations created by virt-controller will be impacted by this.

We can fine tune it binding the new kubevirt.io:migrate cluster role to the service accounts that need it.

@tiraboschi this is great to see, but let's make sure we all agree as this might break the assumption that many users have at this point.
@fossedihelm @xpivarc @jean-edouard @iholder101 @vladikr

Yep. this is a breaking change.
An additional kubevirt.io:migrate clusterrole is defined for the convenience of cluster admins that wants to allow some of their users to continue managing live migrations.

Yep. this is a breaking change.
An additional kubevirt.io:migrate clusterrole is defined for the convenience of cluster admins that wants to allow some of their users to continue managing live migrations.

The preliminary discussion we had with @vladikr and @xpivarc focused on v2, which will come with the target node proposal.
That will not break changes.

/cc

That will not break backward compatibility .

This is fully backward compatible in terms of APIs, the change is only affecting the set of defaults RBAC rules we are shipping at install time, an additional clusterrole is provided for convenience.

That's surprising, all other hotplugs happen automatically. Why is that?

Because that sounded at the time an extreme and because we can actually do it on-the-fly without a migration at all.

That will not break backward compatibility .

This is fully backward compatible in terms of APIs, the change is only affecting the set of defaults RBAC rules we are shipping at install time, an additional clusterrole is provided for convenience.

Then I lost you here.
The operator was deploying by default rbac that allowed namespace admins to migrate. Is it still doing that or not?
Come to think of this again, if there is a mitigation option, breaking backward compatibility in this case may be not so bad. We cab consider this a security fix.

That will not break backward compatibility .

This is fully backward compatible in terms of APIs, the change is only affecting the set of defaults RBAC rules we are shipping at install time, an additional clusterrole is provided for convenience.

Then I lost you here. The operator was deploying by default rbac that allowed namespace admins to migrate. Is it still doing that or not?

This is not touching any exposed API so it will not break any of the rules defined for APIs changes making codes that depends on it incompatible.
It's basic only a mitigation touching the initial set of RBAC rules deployed at install time.
Cluster admins could simply restore the previous behaviour simply binding the new kubevirt.io:migrate clusterrole to who/what needs it.

This is not touching any exposed API so it will not break any of the rules defined for APIs changes making external code that depends on it incompatible.

Well, I am not sure if tenants of a cluster that just got upgraded will agree with you here.
In the end, if a project admin depended on the ability to migrate or if a custom controller on the cluster depended on the ClusterRole you updated, it will break them and a manual intervention will be needed.

It's basic only a mitigation touching the initial set of RBAC rules deployed at install time. Cluster admins could simply restore the previous behaviour simply binding the new kubevirt.io:migrate clusterrole to who/what needs it. It's basically hardening.

Yes, we can declare it as hardening and hopefully get out of it without too much bad feedbacks.
I think it is ok, but there is a need to get wider agreement and then look for the community feedback to land this softly.

Regarding discussion in https://github.com/kubevirt/community/pull/320
Did you consider just securing the new fields?  For example, you could create a cluster role:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cdi-cloner
rules:
- apiGroups: ["kubevirt.io"]
  resources: ["virtualmachineInstancemigration/addednodeselector"]
  verbs: ["create"]

That role can be bound to cluster admins or whoever needs this permission.
In validation webhook, can check if the field is set and use SubjectAccessReview API to validate that the user has permission

Regarding discussion in kubevirt/community#320
Did you consider just securing the new fields? For example, you could create a cluster role:

Yep, but the issue that this PR is trying to resolve is already present and it's basically unrelated to kubevirt/community#320 (although it could make it more evident).
The main problem that we are trying to solve here is that infra critical tasks like the capability to drain a node with active VMs or perform a cluster upgrade or rebalance the cluster can depend (according to how the cluster is configured) to the capability of completing a live migration of a VM.
The real problem we are trying to solve here is that a malicious user without cluster-admin role but only with namespace admin one (AKA a developer owning a namespace), can easily write a controller or a script to continuously enqueue migration requests for his VMs or continuously delete system/infra requested ones as soon as created blocking or strongly delaying infra tasks.

@tiraboschi I was just thinking it could be a compromise solution in the event that the community rejects the solution here

Thank you! My only concern is about the breaking change around the VM live update for affinity and tolerations.
Currently, if a VM owner change the affinity or the tolerations of a VM they will be reflected to the vmi and then can be applied to the pod via restart or live migration. With this, I think that only option 1 will be available.

I think this is

This is not touching any exposed API so it will not break any of the rules defined for APIs changes making external code that depends on it incompatible.

Well, I am not sure if tenants of a cluster that just got upgraded will agree with you here. In the end, if a project admin depended on the ability to migrate or if a custom controller on the cluster depended on the ClusterRole you updated, it will break them and a manual intervention will be needed.

It's basic only a mitigation touching the initial set of RBAC rules deployed at install time. Cluster admins could simply restore the previous behaviour simply binding the new kubevirt.io:migrate clusterrole to who/what needs it. It's basically hardening.

Yes, we can declare it as hardening and hopefully get out of it without too much bad feedbacks. I think it is ok, but there is a need to get wider agreement and then look for the community feedback to land this softly.

+1 from me. I think PR is exactly what we need to restore the original intent of making live-migrations a tool available only to cluster admins.
KubeVirt relies on this core functionality for critical system flows and therefore it must be protected.

Thank you! My only concern is about the breaking change around the VM live update for affinity and tolerations. Currently, if a VM owner change the affinity or the tolerations of a VM they will be reflected to the vmi and then can be applied to the pod via restart or live migration. With this, I think that only option 1 will be available.

We spoke offline and I am not worried about this at the moment.
As a next step, I think we need to implement a priority queue (similar to [1][2]) for live migrations. Then we would be able to easily accommodate the "semi-user-triggered" migrations, such as various hotplugs. These will come with a lower priority compared to upgrades and node drains.
[1] https://github.com/kubernetes-sigs/controller-runtime/pull/3013
[2] https://github.com/kubernetes-sigs/controller-runtime/pull/3014

Looks good to me. I think this is an important step in the right direction.
Thank you @tiraboschi!
/lgtm

A bit off-topic to your PR, but Just a few general questions to make sure I understand correctly:
Are the kubevirt.io:admin and kubevirt.io:edit intended for namespace owners?
What's the difference between them?
I see that we don't create the cluster-admin super-user role. Who creates it?

A bit off-topic to your PR, but Just a few general questions to make sure I understand correctly: Are the kubevirt.io:admin and kubevirt.io:edit intended for namespace owners? What's the difference between them? I see that we don't create the cluster-admin super-user role. Who creates it?

Please refer to: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles
The default user-facing roles on K8s are:

cluster-admin: super-user access to perform any action on any resource in any namespace
admin: intended to be granted within a namespace using a RoleBinding ... allows read/write access to most resources in a namespace
edit: Allows read/write access to most objects in a namespace.
view: Allows read-only access to see most objects in a namespace.

So yes, admin, edit and  edit are supposed to be granted within a namespace (with a RoleBinding pointing to a ClusterRole).
Then we have the cluster role aggregation rules:

rbac.authorization.k8s.io/aggregate-to-admin: "true" (we have it on kubevirt.io:admin)
rbac.authorization.k8s.io/aggregate-to-edit: "true"  (we have it on kubevirt.io:edit)
rbac.authorization.k8s.io/aggregate-to-view: "true"  (we have it on kubevirt.io:view)

That are defined to be able to easily extend admin, edit and view roles.
So, since we have rbac.authorization.k8s.io/aggregate-to-admin: "true" label on kubevirt.io:admin, we are going to extend the admin role (in general given to a namespace owner, inappropriate term sorry) with what is allowed for kubevirt.io:admin (so creating VMs and so on but after this PR not creating VMIMs).
Nothing is really needed for cluster-admin since it's defined as:
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - '*'

Please include mitigation steps in the release note/PR

Done.