Build ios cant be finished.

Describe the issue
A clear and concise description of what the issue is. If possible, paste the output from your terminal.
bogon:outline-client shield$ yarn gulp build --platform=ios
yarn run v1.16.0
$ /Users/shield/Documents/Developer/devOps/chessesVPN/outline/outline-client/node_modules/.bin/gulp build --platform=ios
[02:47:33] Using gulpfile ~/Documents/Developer/devOps/chessesVPN/outline/outline-client/gulpfile.js
[02:47:33] Starting 'build'...
[02:47:33] Starting 'buildWebApp'...
$ bash ./scripts/do_action.sh src/www/build
++ git rev-parse --show-toplevel

export ROOT_DIR=/Users/shield/Documents/Developer/devOps/chessesVPN/outline/outline-client
ROOT_DIR=/Users/shield/Documents/Developer/devOps/chessesVPN/outline/outline-client
export BUILD_DIR=/Users/shield/Documents/Developer/devOps/chessesVPN/outline/outline-client/build
BUILD_DIR=/Users/shield/Documents/Developer/devOps/chessesVPN/outline/outline-client/build
export -f do_action
do_action src/www/build
local action=src/www/build
echo '[Running src/www/build]'
shift
/Users/shield/Documents/Developer/devOps/chessesVPN/outline/outline-client/src/www/build_action.sh
[Running src/www/build]
tsc -p src/www
rsync -ac --exclude '*.ts' src/www/ www/
echo '[Done src/www/build]'
[Done src/www/build]
[02:47:36] Finished 'buildWebApp' after 2.96 s
[02:47:36] Starting 'copyBabelPolyfill'...
node_modules/babel-polyfill/dist/polyfill.min.js -> www/babel-polyfill.min.js
[02:47:36] Finished 'copyBabelPolyfill' after 9.75 ms
[02:47:36] Starting 'browserifyAndBabelify'...
[02:47:38] Finished 'browserifyAndBabelify' after 1.4 s
[02:47:38] Starting 'transpileBowerComponents'...
[02:47:45] Finished 'transpileBowerComponents' after 7.64 s
[02:47:45] Starting 'transpileUiComponents'...
[02:47:45] Finished 'transpileUiComponents' after 104 ms
[02:47:45] Starting 'rtlCss'...
[02:47:45] Generating RTL CSS
[02:47:45] Finished 'rtlCss' after 93 ms
[02:47:45] Starting 'writeEnvJson'...
[02:47:46] Finished 'writeEnvJson' after 332 ms
[02:47:46] Starting 'cordovaPlatformAdd'...
[02:47:46] Finished 'cordovaPlatformAdd' after 8.68 ms
[02:47:46] Starting 'cordovaPrepare'...
cordova-custom-config: Skipping auto-restore of config file backup(s)
Discovered saved plugin "cordova-plugin-clipboard". Adding it to the project

**it's just stop last line ,cant   continue with script. the ios suorce can be run, but when debug it on the iphone ,cant be start vpn server. cant saw any vpn service start.. just put right access key ,the key is running my mac ,and the other phone downloaded from app store.
Environment

OS: [IOS]
Yarn 1.16.0
Node.js v12.14.1
Additional context

debug on Xcode
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file
2020-02-04 02:57:15.880050+0800 Outline[468:66785] [MC] Lazy loading NSBundle MobileCoreServices.framework
2020-02-04 02:57:15.881196+0800 Outline[468:66785] [MC] Loaded MobileCoreServices.framework
2020-02-04 02:57:15.884497+0800 Outline[468:66785] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2020-02-04 02:57:15.889467+0800 Outline[468:66785] Using UIWebView
2020-02-04 02:57:15.891866+0800 Outline[468:66785] [CDVTimer][console] 0.097990ms
2020-02-04 02:57:15.892024+0800 Outline[468:66785] [CDVTimer][handleopenurl] 0.091910ms
2020-02-04 02:57:15.893665+0800 Outline[468:66785] [CDVTimer][intentandnavigationfilter] 1.605988ms
2020-02-04 02:57:15.893782+0800 Outline[468:66785] [CDVTimer][gesturehandler] 0.073910ms
2020-02-04 02:57:15.893821+0800 Outline[468:66785] [CDVTimer][TotalPluginStartup] 2.115965ms
2020-02-04 02:57:15.916277+0800 Outline[468:66831] Metal API Validation Enabled
2020-02-04 02:57:15.989627+0800 Outline[468:66785] refreshPreferences: HangTracerEnabled: 0
2020-02-04 02:57:15.989700+0800 Outline[468:66785] refreshPreferences: HangTracerDuration: 500
2020-02-04 02:57:15.989730+0800 Outline[468:66785] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
2020-02-04 02:57:16.161641+0800 Outline[468:66785] Resetting plugins due to page load.
2020-02-04 02:57:16.193204+0800 Outline[468:66785] Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)
2020-02-04 02:57:16.193534+0800 Outline[468:66785] Resetting plugins due to page load.
2020-02-04 02:57:16.714059+0800 Outline[468:66785] Finished load of: file:///var/containers/Bundle/Application/AAAFEB02-D008-4878-B84D-79C821FEC6CF/Outline.app/www/cordova_index.html
2020-02-04 02:58:15.290917+0800 Outline[468:66785] [MC] Reading from public effective user settings.
2020-02-04 02:58:15.349237+0800 Outline[468:66785] API error: <_UIKBCompatInputView: 0x100c5f9b0; frame = (0 0; 0 0); layer = <CALayer: 0x1c0027da0>> returned 0 width, assuming UIViewNoIntrinsicMetric
2020-02-04 02:58:15.349427+0800 Outline[468:66785] API error: <_UIKBCompatInputView: 0x100c5f9b0; frame = (0 0; 0 0); layer = <CALayer: 0x1c0027da0>> returned 0 width, assuming UIViewNoIntrinsicMetric
2020-02-04 02:58:15.459861+0800 Outline[468:66785] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x1c0291f30 h=-&- v=-&- UIToolbar:0x100c4cc50.width == _UIInputViewContent:0x100c4a350.width   (active)>",
"<NSAutoresizingMaskLayoutConstraint:0x1c0292070 h=--& v=--& _UIInputViewContent:0x100c4a350.width == 0   (active)>",
"<NSLayoutConstraint:0x1c0284510 H:|-(8)-[_UIButtonBarStackView:0x100c4f7d0]   (active, names: '|':_UIToolbarContentView:0x100c4d090 )>",
"<NSLayoutConstraint:0x1c02844c0 _UIButtonBarStackView:0x100c4f7d0.trailing == _UIToolbarContentView:0x100c4d090.trailing   (active)>",
"<NSLayoutConstraint:0x1c02832f0 _UIToolbarContentView:0x100c4d090.trailing == UIToolbar:0x100c4cc50.trailing   (active)>",
"<NSLayoutConstraint:0x1c0281680 H:|-(0)-[_UIToolbarContentView:0x100c4d090]   (active, names: '|':UIToolbar:0x100c4cc50 )>"
)

Yeah installing plugins is really slow on this version of Cordova (9 is it?) and sometimes stalls.
Our solution was to copy the plugins manually, so Cordova wouldn't have to do it:
cp node_modules/cordova-plugin-* plugins/
cp node_modules/{cordova-webintent,es6-promise-plugin} plugins/
cp cordova-plugin-outline plugins/

Then the build completed that stage much more quickly!

Yeah installing plugins is really slow on this version of Cordova (9 is it?) and sometimes stalls.
Our solution was to copy the plugins manually, so Cordova wouldn't have to do it:
cp node_modules/cordova-plugin-* plugins/
cp node_modules/{cordova-webintent,es6-promise-plugin} plugins/
cp cordova-plugin-outline plugins/

Then the build completed that stage much more quickly!
(For our team's convenience, we also added the entire plugins folder to git.)
Hopefully after a future Cordova upgrade, this problem will be resolved.

### ### ### ### ###
Yeah, When I tried it ,I found the other error when I builded again. Some error show below:
If I use yarn run clean it will clean I copied  ,so I did not do yarn clean ,I copied all node_moudles to plugin , and build again ,but different error show... So could you tell what reason...?
### ### ### ### ### ### ### ###
yarn gulp build --platform=ios
yarn run v1.16.0
The following build commands failed:
Check dependencies
(1 failure)
xcodebuild: Command failed with exit code 65
[02:15:43] 'cordovaCompile' errored after 7.42 s
[02:15:43] Error: exited with error code: 65
at ChildProcess.onexit (/Users/shield/outline-client/outline-client/node_modules/end-of-stream/index.js:39:36)
at ChildProcess.emit (events.js:223:5)
at ChildProcess.EventEmitter.emit (domain.js:498:23)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
[02:15:43] 'build' errored after 22 s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I did that all ,but  I still got these error ....What's happen to me...
### ### ###
=== BUILD TARGET VpnExtension OF PROJECT Outline WITH CONFIGURATION Debug ===
Check dependencies
Code Signing Error: No profiles for 'org.outline.ios.client.VpnExtension' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'org.outline.ios.client.VpnExtension'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
Code Signing Error: Code signing is required for product type 'App Extension' in SDK 'iOS 13.2'
** ARCHIVE FAILED **
The following build commands failed:
Check dependencies
(1 failure)
xcodebuild: Command failed with exit code 65
[04:19:19] 'cordovaCompile' errored after 8.89 s
[04:19:19] Error: exited with error code: 65
at ChildProcess.onexit (/Users/shield/Documents/Developer/devOps/chessesVPN/outline/outline-client/node_modules/end-of-stream/index.js:39:36)
at ChildProcess.emit (events.js:223:5)
at ChildProcess.EventEmitter.emit (domain.js:498:23)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
[04:19:19] 'build' errored after 22 s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


Improve config.pb.go generation for out-of-tree adapters

Describe the feature request
The instructions for creating out of process adapters suggests the following command for generating config.pb.go.
//go:generate $GOPATH/src/istio.io/istio/bin/mixer_codegen.sh -a mixer/adapter/mygrpcadapter/config/config.proto -x "-s=false -n mygrpcadapter -t metric"

This has a couple of problems when working with out-of-tree adapters.

It depends on $GOPATH/src/istio.io/istio.
Needs the adapter to be at a relative location within the istio repo i.e. mixer/adapter/mygrpcadapter.

One way to improve this would be to extract the codegen components into a seperate go package and use it to build adapters just by vendoring it.
/cc @mandarjog @oaktowner

I am also interested in this, as this makes OOT adapter development very difficult.

The whole adapter development model is going to change soon with the Mixer v2 architecture.

closing, this does not apply any more.


copied content from Faraday to "Fundamental Laws"

Team C: @dccowan, @sgkang, @micmitch , @krisdavis : can one of you take a look and approve the pull request if you are happy with it? Thanks!
(There will be an error getting the lenz page hooked up properly, we can deal with that separately)

(don't worry about the travis fail for now)


esp32: fix fatal exception output on usb serial

this fixes issue #60825 by not blocking the serial FIFO polling from an interrupt

So, I managed to not only mess up the patch formatting, but also my commit message was badly written. How do I correct that on my pull request? Do I open another one, or is it editable and I'm just too dense to find it?


iOS can't read local notification body

Version: 10.0.3
Tested on: iOS 9.3 and iOS 11.1
Scheduled local notifications seem to work fine when the app is in the background. But when I receive them in the foreground I can't access their body - the notif.notification is undefined.
Receive notifications:
FCM.on(FCMEvent.Notification, async (notif) => {
    if (notif.local_notification) {
        console.log("notif.notification: " + notif.notification)
    }
})

Schedule local notification:
FCM.scheduleLocalNotification({
    fire_date: fireDate,
    id: notificationId,
    body: message,
    show_in_foreground: true,
})

I'd like to show an alert when I receive a local notification (with a notification body) in the foreground, how can I do that?

for local notification, notif itself contains everything.

As far as I can see, notif is Notification type, which is:
export interface Notification {
    collapse_key: string;
    opened_from_tray: boolean;
    from: string;
    notification: {
        title?: string
        body: string;
        icon: string;
    };
    local_notification?: boolean;
    _notificationType: string;
    finish(type?: string): void;
}

So how can I access the notification body differently than using notif.notification?

sorry that type definition is not 100 percent correct. notification object varies a bit depends on the way notification gets created and delivered. console.log the notification you get will get a better idea what field to use

Ok, now I understand. So this is the solution:
FCM.on(FCMEvent.Notification, async (notif) => {
    if (notif.local_notification) {
        const localNotification = <any>notif as LocalNotification
        // ...
    }
})

Unfortunatelly you have to force casting.

hmm...yes


Circular image?

Hello,
I'm wondering whether it's possible to create a circular image in JIMP i.e. creating a 200x200 transparent canvas and create a circle on top of it with a radius of 200px. The aim is to create Firefox OS favicons e.g.

This is very easy using masks:
var p1 = Jimp.read("lenna.png");
var p2 = Jimp.read("mask.png");

Promise.all([p1, p2]).then(function(images){
	var lenna = images[0];
	var mask = images[1];
	lenna.mask(mask, 0, 0).write("lenna-circle.png");
});

And this is exactly the purpose I wrote Jimp for BTW. Best of luck!

Yep that was my fallback solution, problem is when you're programmatically generating images of different sizes, scaling a single size mask won't give the best quality, but no matter.

Is it that bad? Try creating just one "high resolution" icon then scaling and saving that:
var p1 = Jimp.read("lenna.png");
var p2 = Jimp.read("mask.png");

Promise.all([p1, p2]).then(function(images){
	var lenna = images[0];
	var mask = images[1];

	lenna.mask(mask, 0, 0).write("lenna-circle.png");

	var sizes = [256, 128, 64, 60, 48, 32, 30, 16];

	for (var i = 0; i < sizes.length; i++) {
		lenna.clone().resize(sizes[i], Jimp.AUTO)
		.write("lenna-circle" + i + ".png");
	}
});

It'll definitely work, just saying it won't be absolutely pixel-perfect, but I guess then again neither will the resized image so it's all good :)

@oliver-moran, @haydenbleasel : I was trying to do the exact same thing today. I just wanted to know if I understood the concept of mask correctly.
If I have an image with dimensions x*x and want to create the circular crop for it, I first have to generate the mask image on the fly. Is that correct?

@oliver-moran is there possibility to make transparent corners? I want to generate circular avatar and composite it with another image but that image has not white background


TypeError: Abstract value passed to bool

Hi,
I'm trying to sample from an exponential distribution using Metropolis-Hasting sampling, and I'm getting the error above when I'm trying to jit the sampling function.
This is the code I'm trying to run is:
N = 10

marg_1 = lambda i,x:x[i]
marg_2 = lambda i,j,x:x[i]*x[j]

marg_1s = [jit(partial(marg_1,i)) for i in range(N)]
marg_2s = [jit(partial(marg_2,i,j)) for i,j in list(it.combinations(range(N),r=2))]
funcs = marg_1s+marg_2s

@jit
def calc_e(factors,word):
    return np.sum([factor*func(word) for factor,func in zip(factors,funcs)])

@jit
def sample(factors,N=10,seed=0,n_samps=100):
    key = random.PRNGKey(seed)
    key, subkey = random.split(key)

    state = random.randint(subkey,minval=0,maxval=2, shape=(N,))
    all_states = []

    for _ in range(n_samps):
        all_states.append(state)
        for i in range(N):
            #flip sign
            state_flipped = index_update(state,i,1-state[i])
            #calc energy difference
            dE = calc_e(factors,state_flipped)-calc_e(factors,state)
            if dE < 0:
                state = state_flipped
            else:
                key, subkey = random.split(key)
                rand=random.uniform(subkey,shape=(1,))
                if rand < np.exp(-dE):
                    state = state_flipped
    return all_states

And I'm getting the following error message:
TypeError: Abstract value passed to `bool`, which requires a concrete value. The function to be transformed can't be traced at the required level of abstraction. If using `jit`, try using `static_argnums` or applying `jit` to smaller subfunctions instead.

The full trace shows the error is in the if dE < 0 line. I've read #480  and #196 but wasn't able to understand how to solve the problem (or if it's even solvable).  Is there anything I can do to solve this?

My guess is that using np.where here in place of the conditionals is a good strategy. So maybe something like (untested)
key, subkey = random.split(key)
accept = (dE < 0) | (random.uniform(subkey, ()) < np.exp(-dE))
state = np.where(accept, state_flipped, state)

That will compute both sides of the conditionals and throw one side away. (In principle XLA could be lazy and only evaluate one side, but in practice it's not.) For this simple part of the calculation, that's not going to waste much effort, especially on a parallel machine.
This next part is just academic. If you ever wanted to stage out a conditional like a Python if, where only one side is evaluated, you'd have to use lax.cond here instead of the Python if construct. The reason is that JAX needs to trace both sides of the conditional to compile it (because the boolean doesn't have a concrete value while tracing), but our simple tracing technique doesn't let us do that easily on Python control flow. However, I expect lax.cond to have overheads relative to np.where because it can probably foil a lot of XLA's optimizations.
A third alternative would be not to compile this whole function, but instead to compile sub-functions like calc_e, and just stay in regular Python for the sample function. But that's probably not a good fit for this kind of computation; unless your energy calculation is very expensive to compute, you probably want to stage the whole sample function out of Python.

Thanks @mattjj for the detailed response!
I've tried using the code you suggested, and it indeed solved the problem reported above; however, sampling is very very slow - it takes me > 20 seconds to produce tens of samples; this is order of magnitude slower than a pure-Python version. Is this an expected behavior? I've used snakeviz to profile the following cell:
%%snakeviz

@jit
def sample(factors,seed=0,n_samps=20):
    key = random.PRNGKey(seed)
    key, subkey = random.split(key)
    state = random.randint(subkey,minval=0,maxval=2, shape=(N,))

    all_states = []
    for _ in range(n_samps):
        all_states.append(state)
        for i in range(state.size):
            #flip sign
            state_flipped = index_update(state,i,1-state[i])
            #calc energy difference
            dE = calc_e(factors,state_flipped)-calc_e(factors,state)
            key, subkey = random.split(key)
            accept = (dE < 0) | (random.uniform(subkey, ()) < np.exp(-dE))
            state = np.where(accept, state_flipped, state)
    return all_states

sample(factors)

This is the profiling output:

ncalls
tottime
percall
cumtime
percall
filename:lineno(function)

29
4.877
0.1682
4.877
0.1682
~:0(built-in method _pywrap_xla.Computation_Compile)

113727/107234
0.3531
3.293e-06
1.071
9.986e-06
util.py:38(safe_map)

2711
0.16
5.901e-05
0.1735
6.398e-05
~:0(built-in method _pywrap_xla.LocalExecutable_Execute)

326954/312810
0.1347
4.305e-07
0.1572
5.025e-07
~:0(built-in method builtins.isinstance)

1609/29
0.1281
0.004417
1.356
0.04676
xla.py:145(jaxpr_computation)

28127
0.07463
2.653e-06
0.1224
4.35e-06
xla_client.py:504(init)

28087
0.07277
2.591e-06
0.2695
9.595e-06
xla_client.py:485(array_shape)

187890
0.06856
3.649e-07
0.06856
3.649e-07
~:0(built-in method builtins.len)

14434
0.06807
4.716e-06
0.1347
9.332e-06
linear_util.py:165(hashable_payload)

44633
0.06671
1.495e-06
0.1846
4.135e-06
core.py:267(getattr)

68117
0.06142
9.017e-07
0.1404
2.061e-06
partial_eval.py:202(aval)

(I've truncated the profiling trace since the first line is where most of the time is spent anyway)
It seems like the compilation part (which I admittedly know very little about) takes most of the time. Calling the sample function with a different seed seems to require re-compilation. If I understand it correctly, it means each time I'm planning to sample from the distribution using a different seed/initial state, the function will be recompiled. Since my use case involved hundreds or thousands of such calls, this sounds like it makes it impracticable. Is there any way to resolve this?
Somewhat unrelated - I find this topic super interesting, but I don't have much prior knowledge in all of this. Is there any good tutorial somewhere (other than the jax/xla github pages) where I can learn more about the subject?

There's certainly too much recompilation going on. Can you provide a full repro?

Sure. Here's the full code:
%load_ext snakeviz

import jax.numpy as np
import jax.random as random
from jax import jit
from jax.ops import index_update
import numpy as onp
from functools import partial
import itertools as it

N = 4

marg_1 = lambda i,x:x[i]
marg_2 = lambda i,j,x:x[i]*x[j]

marg_1s = [jit(partial(marg_1,i)) for i in range(N)]
marg_2s = [jit(partial(marg_2,i,j)) for i,j in list(it.combinations(range(N),r=2))]
funcs = marg_1s+marg_2s

def calc_e(factors,word):
    return np.sum([factor*func(word) for factor,func in zip(factors,funcs)])

factors = np.array(onp.random.randn(len(funcs))*0.01)

%%snakeviz

@jit
def sample(factors,seed=0,n_samps=20):
    key = random.PRNGKey(seed)
    key, subkey = random.split(key)
    state = random.randint(subkey,minval=0,maxval=2, shape=(N,))

    all_states = []
    for _ in range(n_samps):
        all_states.append(state)
        for i in range(state.size):
            #flip sign
            state_flipped = index_update(state,i,1-state[i])
            #calc energy difference
            dE = calc_e(factors,state_flipped)-calc_e(factors,state)
            key, subkey = random.split(key)
            accept = (dE < 0) | (random.uniform(subkey, ()) < np.exp(-dE))
            state = np.where(accept, state_flipped, state)
    return all_states

sample(factors)

Small update, in case it helps focusing on the problem - all the above was on CPU mode; I finally installed JAX on a machine with a GPU and reproduced the same behavior (tens of seconds for tens of samples).

Hi @mattjj! I've went over @rlouf's implementation, and slightly adjusted it to the binary sampling case (hopefully in a reasonable way):

@partial(jax.jit, static_argnums=(1,))
def rw_metropolis_kernel(rng_key, logpdf, position, log_prob, i):
    key1, key2 = jax.random.split(rng_key)
    proposal = index_update(position, i%N, 1-position[i%N])
    proposal_log_prob = logpdf(proposal)

    log_uniform = np.log(jax.random.uniform(key2))
    do_accept = log_uniform < proposal_log_prob - log_prob

    position = np.where(do_accept, proposal, position)
    log_prob = np.where(do_accept, proposal_log_prob, log_prob)
    return position, log_prob

@partial(jax.jit, static_argnums=(1, 2))
def rw_metropolis_sampler(rng_key, n_samples, logpdf, initial_position):
    def mh_update(i, state):
        key, position, log_prob = state
        _, key = jax.random.split(key)
        new_position, new_log_prob = rw_metropolis_kernel(key, logpdf, position, log_prob, i)
        return (key, new_position, new_log_prob)

    logp = logpdf(initial_position)
    rng_key, position, log_prob = jax.lax.fori_loop(0, n_samples, mh_update, (rng_key, initial_position, logp))
    return position

n_chains = 100000
n_dim = 50
rng_key = jax.random.PRNGKey(1)
rng_keys = jax.random.split(rng_key, n_chains)
initial_position = (jax.random.uniform(rng_key,shape=(n_dim, n_chains))>0.5).astype(int)

run_mcmc = jax.vmap(rw_metropolis_sampler, in_axes=(0, None, None, 1),
                    out_axes=0)

factors = np.sort((jax.random.normal(rng_key, shape=m.factors.shape)*0.03))

%time positions_comp = run_mcmc(rng_keys, n_samples, logpdf, initial_position).block_until_ready()

This is roughly as fast as my previous implementation (~5 sec for 100000 samples from an N=50 all-to-all Ising model); This is still ~15 times slower than the C++ implementation I'm trying to replace, but perhaps that's unavoidable...
Is there anything obvious in the above code that can be further optimised? Perhaps there's a better way (batched/pre-generated) to handle random number generation?

I suspect the performance hit is due to the index_update in the kernel. I'll have a look over the weekend.

@adamhaber  It seems generating keys in batches can give a significant performance improvement #1421 (around 2x to 3x in the reported issue)

I'm going to close this issue because it's pretty old. We're still working on improvements to PRNG performance on some backends, but there are other open issues tracking that.

I'm going to close this issue because it's pretty old. We're still working on improvements to PRNG performance on some backends, but there are other open issues tracking that.


Add CORS option to config

Currently cross domain requests are blocked on the HTTP API. A need was mentioned on Gitter to allow this. It appears Flask has a CORS module that looks trivial to add. Though I would think you'd want to add it in an optional way such as cors: true in the config file.
https://flask-cors.readthedocs.io/en/latest/

It looks like enabling CORS should be as easy as adding a Access-Control-Allow-Origin: * header to the server response or even better a Access-Control-Allow-Origin: origins_specified_in_config_file.

Sounds good :+1:

done


Update Dockerfile

The minimum required version of Golang is version 1.17

Thanks, we missed this in #417


Migration to https://github.com/gogo/protobuf

https://medium.com/@nevio/golang-dealing-with-protocol-buffer-omitempty-and-boolean-json-responses-ae1ba5f4e9c3

bad idea


ESMValTool v2.10.0 environment on JASMIN causes test failures

Describe the bug
@mo-gill is currently working on installing ESMValTool v2.10.0 at the Met Office.
However, our first attempt to create an ESMValTool v2.10.0 environment caused some of the tests fail. So I thought I'd check the ESMValTool v2.10.0 environment on JASMIN. There are test failures on JASMIN too:
[...]
---------- Generated html report: file:///home/users/ehogan/software/ESMValTool/test-reports/report.html -----------
============================================= short test summary info ==============================================
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline0-kwargs0-None] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedRFE::test_advanced_rfe_no_fit_kwargs - AssertionError: assert [('passthroug...o-one'), [0])] == [('passthroug...hrough', [0])]
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedRFE::test_advanced_rfe_fit_kwargs - AssertionError: assert [('passthroug...o-one'), [0])] == [('passthroug...hrough', [0])]
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline1-kwargs1-output1] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline2-kwargs2-output2] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline3-kwargs3-output3] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline6-kwargs6-output6] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/test_diagnostic_run.py::test_diagnostic_run[diagnostic.jl] - SystemExit: 1
======================= 9 failed, 1453 passed, 1 skipped, 584 warnings in 241.91s (0:04:01) ========================

The MO failures are due to issues that have since been fixed in ESMValTool:

#3504
#3516

It looks like the first of these is causing the test failures on JASMIN.
I don't know how environments are created on JASMIN, but we fixed this at the MO by including a scikit-learn=1.3.2 pin (which is the version used in the lock file in v2.10.0) and adding <8.0 to the pytest specification.
Should the JASMIN environment be updated such that the tests pass? 🤔

hi @ehogan you are absolutely correct: on JASMIN we got:
scikit-learn              1.4.0           py311hc009520_0    conda-forge

which is no bueno; but given that nobody's yet complained about this issue, and it's a bit of a faff for me to update the environment, given 2.11 is knocking on the door and I'll have to install it anyway, I'll do the update when I get to install 2.11. Cheers for pointing out :beer:

also, I just checked my install log for 2.10 centrally on JASMIN and lo and behold I have this:
Test fails list
===============
skikit-learn related test fails (normal)

---------------- Generated html report: file:///apps/jasmin/community/esmvaltool/ESMValTool_2.10.0/test-reports/report.html -----------------
========================================================== short test summary info ==========================================================
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline0-kwargs0-None] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline1-kwargs1-output1] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline2-kwargs2-output2] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline3-kwargs3-output3] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit_transformers_only[pipeline6-kwargs6-output6] - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedRFE::test_advanced_rfe_no_fit_kwargs - AssertionError: assert [('passthroug...o-one'), [0])] == [('passthroug...hrough', [0])]
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedRFE::test_advanced_rfe_fit_kwargs - AssertionError: assert [('passthroug...o-one'), [0])] == [('passthroug...hrough', [0])]
FAILED tests/integration/diag_scripts/mlr/test_custom_sklearn_classes.py::TestAdvancedPipeline::test_fit - TypeError: Pipeline._fit() got an unexpected keyword argument 't'
==================================== 8 failed, 1454 passed, 1 skipped, 78 warnings in 577.01s (0:09:37) ===

so it appears we considered those fails normal - I now remember I had a chat with @schlunma and he'd mentioned those fails don't degrade the recipe runs (llikewise when I ran the tests just now I had 8, not 9 fails) so if you don't mind, am gonna close this and leave the environment as is, @ehogan :beer:

about Julia - Julia test diagnostic's been broken since ages, see this https://github.com/ESMValGroup/ESMValTool/pull/3476 - I've been trying to fix it but unfortunately I don't speak her language all too well :grin:

[...] Cheers for pointing out 🍺

[...] so if you don't mind, am gonna close this and leave the environment as is, @ehogan 🍺

No problem at all! Just thought I would do my due diligence and report it 👍 🍻

about Julia - Julia test diagnostic's been broken since ages, see this https://github.com/ESMValGroup/ESMValTool/pull/3476 - I've been trying to fix it but unfortunately I don't speak her language all too well 😁

Our failure is because we don't install Julia at the MO; I was actually thinking about opening an issue to skip the Julia test if it's not installed. Would that be reasonable? 🤔

Yeah, to make them pass in our v2.10.0, we would have needed to pin sklearn<1.4.0, which we didn't do (because we were not aware of that issue at the time). So if you do a fresh installation of v2.10 right now, you get sklearn>=1.4.0, which will cause the tests to fail.
The proper way to fix this is probably a repodata patch (e.g. https://github.com/conda-forge/conda-forge-repodata-patches-feedstock/pull/455). This has been properly solved in v2.11 in our code.

[...] Cheers for pointing out 🍺

[...] so if you don't mind, am gonna close this and leave the environment as is, @ehogan 🍺

No problem at all! Just thought I would do my due diligence and report it 👍 🍻

excellent! We need more of these :smiley:

about Julia - Julia test diagnostic's been broken since ages, see this #3476 - I've been trying to fix it but unfortunately I don't speak her language all too well 😁

Our failure is because we don't install Julia at the MO; I was actually thinking about opening an issue to skip the Julia test if it's not installed. Would that be reasonable? 🤔

why not? It's a PITA and we only have like one recipe that nobody runs :rofl:

Manu, I can't be arsed to do a repodata patch, unless you tell me it's vital :grin:

about Julia - Julia test diagnostic's been broken since ages, see this #3476 - I've been trying to fix it but unfortunately I don't speak her language all too well 😁

Our failure is because we don't install Julia at the MO; I was actually thinking about opening an issue to skip the Julia test if it's not installed. Would that be reasonable? 🤔

why not? It's a PITA and we only have like one recipe that nobody runs 🤣

New issue opened: https://github.com/ESMValGroup/ESMValTool/issues/3599 🥳

Manu, I can't be arsed to do a repodata patch, unless you tell me it's vital 😁

No, it's certainly not 😁

@schlunma


Visualization

Can you also provide the visualization script as shown in video please?

Maybe you can see：https://github.com/Megvii-BaseDetection/BEVDepth/blob/main/scripts/visualize_nusc.py

Thank you @chloexiangyy, you can modify that script to visualize samples.
I also utilized that script and nuscenes official visualization script.


[occm] Reintroduce seeding of math/rand source

In Go v1.20, rand.Seed is deprecated and math/rand's is automatically seeded. However, that doesn't happen in Go v1.19 that is used to build this branch.
With this change, the global source for math/rand is seeded again in main.go.
In a separate commit, this PR bumps golangci-lint to v1.51.2, which handles the deprecation more gracefully.
What this PR does / why we need it:
rand.Seed was prematurely removed in a previous commit.
Which issue this PR fixes(if applicable):
fixes #2120
Release note:
NONE

/cherry-pick release-1.26
/cc @zetaab @jichenjc

/ok-to-test


[Pubsub RabbitMQ] Single Active consumer subscription parameter

What content needs to be created or modified?
Add the singleActiveConsumer parameter to RabbitMQ PubSub Subscription metadata
Describe the solution you'd like
Where should the new material be placed?
https://github.com/dapr/docs/blob/v1.13/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-rabbitmq.md
The associated pull request from dapr/dapr, dapr/components-contrib, or other Dapr code repos
https://github.com/dapr/components-contrib/pull/3437
Additional context

@DropSnorz - Please complete this docs issue


Color match the axis in Highcharts transformers when just one metric is being used

Coverage increased (+0.006%) to 97.252% when pulling 4ac92dd077105dda8cd3d6168b1c72324120d86f on x8lucas8x:color-match-the-axis-in-highcharts-transformers into f764f6b608683ebd68dbf902c30726049784a25e on kayak:master.


fix developer mode patch

i did an endianness and changed it from making it add 0x1 to adding 0x1000000

@X7HYPER whar

OᑎE ᑭIEᑕE ᗩT ᗩ TIᗰE , TᕼᗩTᔕ ᕼOᗯ Iᗰ ᗪOIᑎG TᕼIᗪ ᖴᑌᒪᒪ ᒍᗩIᒪᗷᖇEᗩK


Default Parameters of Constructor of Experiment class

In the class expan.core.experiment.Experiment, the constructor starts with the following:
def init(self, control_variant_name, data, metadata, report_kpi_names=[], derived_kpis=[]):
It is not a good idea to have mutable values (i.e. empty list) as the default parameter value because Python does not create a new empty list for you every time you create an object. Instead, it creates it only once and then, it will reference to the same list every time so the next time you create an Experiment object, it is possible that a non-empty list is passed to the function.
I suggest to replace the square brackets by "None". And then, inside the function
if report_kpi_names is None:
report_kpi_names = list()
In that case, it can guarantee an empty list for the function.
Details of this problem can be found: http://docs.python-guide.org/en/latest/writing/gotchas/

Thank you @michaelcyng. That's a good point. Will address it soon.

done in #152


deck: 1.29.2 -> 1.32.0

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/Kong/deck/releases.
meta.description for deck is: A configuration management and drift detection tool for Kong
meta.homepage for deck is: https://github.com/Kong/deck
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.30.0 with grep in /nix/store/w22fs2wxfxxzp8w2g5mw79fg5a4hx9jw-deck-1.30.0
found 1.30.0 in filename of file in /nix/store/w22fs2wxfxxzp8w2g5mw79fg5a4hx9jw-deck-1.30.0

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
deck

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/w22fs2wxfxxzp8w2g5mw79fg5a4hx9jw-deck-1.30.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A deck https://github.com/r-ryantm/nixpkgs/archive/c5fa2999eba6323d0185458ec98c3301e5117537.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/c5fa2999eba6323d0185458ec98c3301e5117537#deck

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/w22fs2wxfxxzp8w2g5mw79fg5a4hx9jw-deck-1.30.0
ls -la /nix/store/w22fs2wxfxxzp8w2g5mw79fg5a4hx9jw-deck-1.30.0/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

deck

Maintainer pings
cc @liyangau for testing.

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/Kong/deck/releases.
meta.description for deck is: A configuration management and drift detection tool for Kong
meta.homepage for deck is: https://github.com/Kong/deck
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.32.0 with grep in /nix/store/gxhsd8ckxm0k3zqv5hj9is0jb66a9m8f-deck-1.32.0
found 1.32.0 in filename of file in /nix/store/gxhsd8ckxm0k3zqv5hj9is0jb66a9m8f-deck-1.32.0

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
deck

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/gxhsd8ckxm0k3zqv5hj9is0jb66a9m8f-deck-1.32.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A deck https://github.com/r-ryantm/nixpkgs/archive/6c2de8fd749564bc769a69357ca88afa35501e92.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/6c2de8fd749564bc769a69357ca88afa35501e92#deck

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/gxhsd8ckxm0k3zqv5hj9is0jb66a9m8f-deck-1.32.0
ls -la /nix/store/gxhsd8ckxm0k3zqv5hj9is0jb66a9m8f-deck-1.32.0/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

deck

Maintainer pings
cc @liyangau for testing.


Fixed gcc 11.1 compilation errors

Arch Linux x86_64 - gcc 11.0.0 x86_64-pc-linux-gnu
ShaderConductor.hpp uses uint*_t types but hasn't included stdint.h
ShaderConductor.cpp has std::atomic<ULONG> m_ref = 0; which gives:
error: use of deleted function 'std::atomic<long unsigned int>::atomic(const std::atomic<long unsigned int>&)'
Use of deleted function with std::atomic

when will this be merged?

never


Root folder in chart_path leads to git repo in git repo

While using git repos for helm charts works great for charts that are in subfolders, it becomes impractical once the helm chart is in the root folder.
In a Monrepo approach for GitOps, there is then a git repo in a git repo, which makes checking in the files difficult.
Example:
charts:
  - name: netbox
    repo_name: bootc-netbox-git
    chart_path: /
    version: 9f537a99928d42f9f1854e95c605db8bc352d4c8
repos:
  - name: stable
    url: https://charts.helm.sh/stable
  - name: bootc-netbox-git
    type: git
    url: https://github.com/bootc/netbox-chart.git
destinations:
  - name: default
    path: ./foobar

Maybe it makes sense here to add an option to delete the .git folder after checkout?

Hello @Zaunei! I like that idea :wink:
Maybe one could use the Skip option when copying the cloned files from the temp directory to the configured destination:
https://github.com/Qovery/helm-freeze/blob/9c2d068aae86ab801ef483c6025f700abb971955/exec/helm.go#L226
opts := copy.Options{
  Skip: func(src string) (bool, error) {
    return filepath.Base(src) == ".git", nil
  }
}

err = copy.Copy(clonedRepoDir+"/"+repoPath, chartFolderDestName, opts)

But I don't think we should do it by default, so we would need to add an option to skip copying this file:
repos:
  # ...
  - name: bootc-netbox-git
    type: git
    keep_git_directory: false
    url: https://github.com/bootc/netbox-chart.git

keepGitDirectory := true

for _, repo := range repos {
        if repo.kind == "git" && repo.name == chart["repo_name"] {
                keepGitDirectory = repo.keepGitDirectory
                chartUrl = repo.url
                break
        }
}

// ...

opts := copy.Options{
    Skip: func(src string) (bool, error) {
        return !keepGitDirectory && filepath.Base(src) == ".git", nil
    }
}

err = copy.Copy(clonedRepoDir+"/"+repoPath, chartFolderDestName, opts)

// ...