Issues with OpenTelemetry Azure & Next.JS "statsbeatMetrics". Module not found: Can't resolve 'os'

@azure/monitor-opentelemetry-exporter:
1.0.0-beta.12:
Operating system:
[x] nodejs

18.16.0:

[x] typescript

4.9.5:

Is the bug related to documentation in

[ ] README.md
[ ] source code documentation
[x] SDK API docs on https://docs.microsoft.com

Describe the bug
Running @azure/monitor-opentelemetry-exporter on a Next.JS solution results in below error:
../../node_modules/@azure/monitor-opentelemetry-exporter/dist-esm/src/export/statsbeat/statsbeatMetrics.js:6:0 Module not found: Can't resolve 'os'
To Reproduce
Steps to reproduce the behavior:

Following two documentation resources Next JS and Microsoft
create instrumentation.ts with the following

import { AzureMonitorTraceExporter } from '@azure/monitor-opentelemetry-exporter'
import { Resource } from '@opentelemetry/resources'
import {
  NodeTracerProvider,
  SimpleSpanProcessor,
} from '@opentelemetry/sdk-trace-node'
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'

export async function register() {
  const provider = new NodeTracerProvider({
    resource: new Resource({
      [SemanticResourceAttributes.SERVICE_NAME]: 'my-app',
    }),
  })

  // Create an exporter instance
  const exporter = new AzureMonitorTraceExporter({
    connectionString:
      process.env['APPLICATIONINSIGHTS_CONNECTION_STRING'] ||
      '<your connection string>',
  })

  provider.addSpanProcessor(new SimpleSpanProcessor(exporter))
  provider.register()
}

Run app results in executing register() and error appear.

Expected behavior
Allow logging Next.JS OpenTelemetry logs to Application Insights
Additional context
Next.js is quite widely used today and could be interesting to get some examples from MS on how to work with these tools on their Azure platform

Hi @lillheaton, unfortunately exporting from a web project (NextJS) in the browser to Azure via the exporter is not currently supported as there is no browser exporter or OTLP endpoint available.

@lillheaton closing as not supported


Update changelog for v2024.10.22 release

Please let me know of any important changes that you want to make visible by adding to the Change log.

Bug Fixes

https://github.com/bazelbuild/intellij/pull/6847
https://github.com/bazelbuild/intellij/pull/6883
https://github.com/bazelbuild/intellij/pull/6888
https://github.com/bazelbuild/intellij/pull/6885
https://github.com/bazelbuild/intellij/pull/6903
https://github.com/bazelbuild/intellij/pull/6901
https://github.com/bazelbuild/intellij/pull/6910

Features

https://github.com/bazelbuild/intellij/pull/6625
https://github.com/bazelbuild/intellij/pull/6726
https://github.com/bazelbuild/intellij/pull/6900
https://github.com/bazelbuild/intellij/pull/6813
https://github.com/bazelbuild/intellij/pull/6916


Not working for Total WarHammer 3

I get this error.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
sh: 1: ./home/fox/.steam/debian-installation/steamapps/common/Total: not found
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
fox@fox-pc:~/.steam/debian-installation/steamapps/common/Total War WARHAMMER III$
Btw I add dlcs to cream api
364360 = Total War: WARHAMMER
594570 = Total War: WARHAMMER II
2325830	= Total War: WARHAMMER III – Shadows of Change
1374300 = Total War: WARHAMMER III - Blood for the Blood God III
1670540 = Total War: WARHAMMER III - Ogre Kingdoms
1824060 = Total War: WARHAMMER III - Champions of Chaos
1834020 = Total War: WARHAMMER III - Chaos Warriors
1834021 = Total War: WARHAMMER III - Blood for the Blood God
1834022 = Total War: WARHAMMER III - Call of the Beastmen
1834023 = Total War: WARHAMMER III - The Grim and the Grave
1834024 = Total War: WARHAMMER III - Wurrzag
1834025 = Total War: WARHAMMER III - The King and the Warlord
1834026 = Total War: WARHAMMER III - Grombrindal The White Dwarf
1834027 = Total War: WARHAMMER III - Realm of The Wood Elves
1834030 = Total War: WARHAMMER III - Bretonnia
1834031 = Total War: WARHAMMER III - Isabella von Carstein
1834032 = Total War: WARHAMMER III - Krell
1834033 = Total War: WARHAMMER III - Norsca
1834034 = Total War: WARHAMMER III - 30th Anniversary Regiments
1834035 = Total War: WARHAMMER III - Jade Wizard
1834036 = Total War: WARHAMMER III - Grey Wizard
1834037 = Total War: WARHAMMER III - Rise of the Tomb Kings
1834038 = Total War: WARHAMMER III - Tretch Craventail
1834039 = Total War: WARHAMMER III - The Queen & The Crone
1834040 = Total War: WARHAMMER III - Steps of Isha
1834041 = Total War: WARHAMMER III - Alith Anar
1834042 = Total War: WARHAMMER III - Bone Giant
1834043 = Total War: WARHAMMER III - Curse of the Vampire Coast
1834044 = Total War: WARHAMMER III - Lokhir Fellheart
1834045 = Total War: WARHAMMER III - The Prophet & The Warlock
1834046 = Total War: WARHAMMER III - Tiktaq'to
1834047 = Total War: WARHAMMER III - Amethyst Wizard
1834048 = Total War: WARHAMMER III - The Hunter and the Beast
1834049 = Total War: WARHAMMER III - Gor-Rok
1834050 = Total War: WARHAMMER III - Gotrek & Felix
1834051 = Total War: WARHAMMER III - The Shadow & The Blade
1834052 = Total War: WARHAMMER III - Repanse de Lyonesse
1834053 = Total War: WARHAMMER III - The Warden & The Paunch
1834054 = Total War: WARHAMMER III - Imrik
1834055 = Total War: WARHAMMER III - Black Orc Big Boss
1834056 = Total War: WARHAMMER III - Catchweb Spidershrine
1834057 = Total War: WARHAMMER III – The Twisted & The Twilight
1834058 = Total War: WARHAMMER III - Skaven Chieftain
1834060 = Total War: WARHAMMER III – Glade Captain
1834061 = Total War: WARHAMMER III - Rakarth
1834062 = Total War: WARHAMMER III – The Silence & The Fury
1834063 = Total War: WARHAMMER III - Blood for the Blood God II
1834064 = Total War: WARHAMMER III - Thorek Ironbrow
1834065 = Total War: WARHAMMER III - Great Bray Shaman
1834066 = Total War: WARHAMMER III - Ogre Mercenaries
2059190 = chaosdwarf

This error suggests that spaces are not being handled properly somewhere, probably some missing quotation marks:
sh: 1: ./home/fox/.steam/debian-installation/steamapps/common/Total: not found, because the actual executable is probably called something like Total War Warhammer III. You used one of the launch parameters from the readme, right? I'm doing some testing right now, will report back in a bit.

I just tested and it appears that games with spaces in their name launch correctly for me using creamlinux, weird. Which launch parameters did you use exactly?

I use directly static path instead relative path.

And I try to ck3 either it give not permission error
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
sh: 1: ./cream.sh: Permission denied
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

Update I add sudo to command and
I take this error either.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[sudo] password for fox:
ERROR: ld.so: object '/tmp/lib64Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/tmp/libsteam_api.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
steam-launch-wrapper: $XDG_RUNTIME_DIR not set.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

And I try to ck3 either it give not permission error

Try running chmod +x ./cream.sh in the directory, the script's execution permission isn't set apparently. Can you post your exact launch parameters, please?

ck3 files

Stuck

If you wanna see live my discord id is yagizm

This is warhammer 3 error.

@anticitizn
I worked to warhammer and I get this error.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[sudo] password for fox:
/home/fox/.steam/debian-installation/steamapps/common/Total War WARHAMMER III
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/tmp/lib64Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/tmp/libsteam_api.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
pid 180325 != 180324, skipping destruction (fork without exec?)
pid 180328 != 180324, skipping destruction (fork without exec?)
pid 180332 != 180324, skipping destruction (fork without exec?)
pid 180331 != 180324, skipping destruction (fork without exec?)
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
TotalWarhammer3: crash reporter initialised with path "/home/fox/.local/share/feral-interactive/Total War WARHAMMER III/crashes"
SDL2 initialised [built against 2.0.12, running with 2.0.12]
[S_API] SteamAPI_Init(): Loaded '/home/fox/.steam/debian-installation/linux64/steamclient.so' OK.
Setting breakpad minidump AppID = 1142710
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:<PHONE_NUMBER>6222632 [API loaded no]
ERROR: ld.so: object '/tmp/lib32Creamlinux.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[0219/184831.762742:ERROR:gpu_process_transport_factory.cc(1026)] Lost UI shared context.
Fossilize INFO: Overriding serialization path: "/home/fox/.steam/debian-installation/steamapps/shadercache/1142710/fozpipelinesv6/steamapprun_pipeline_cache".
[0219/184831.934243:INFO:CONSOLE(8672)] "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", source: file:///home/fox/.steam/debian-installation/steamapps/common/Total%20War%20WARHAMMER%20III/share/FeralUI/Core/3rdParty/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js (8672)
[0219/184831.941453:INFO:CONSOLE(0)] "Styling master document from stylesheets defined in HTML Imports is deprecated. Please refer to https://goo.gl/EGXzpw for possible migration paths.", source:  (0)
[0219/184831.967279:INFO:CONSOLE(6569)] "The specified value "!" does not conform to the required format.  The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.", source: file:///home/fox/.steam/debian-installation/steamapps/common/Total%20War%20WARHAMMER%20III/share/FeralUI/Core/3rdParty/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js (6569)
Opening in existing browser session.
Shutdown handler: initalize.
Shutdown handler: cleanup.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/fox/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

Its opening launher first and creamapi inject to launcher. not game I think.

fixed change to compatibility to proton and add cream api dll.

Hi, sorry for late response, got work :(

Its opening launher first and creamapi inject to launcher. not game I think. You should add when app closing search pid to same folder location any process have.
Launchers have been known to cause some issues in the past, but creamlinux still works in all games with launchers that I've tried (Stellaris, HOI4, etc). Is there an option to skip the launcher? Some steam games offer a setting for this in their properties.

fixed change to compatibility to proton and add cream api dll.
Did you make some additions to creamlinux locally? I would like to see them if you did (or open a pull request if you have time for it). Creamlinux isn't designed to work with proton, regular cream API should do just fine in that case.

Im adding creamapi dll(no .so file) to proton version.

And for ck 3 https://cs.rin.ru/forum/viewtopic.php?p=2990426#p2990426 you need the install dlc
and change steamapi dll to ck3 inside and paradox launcher inside.

about update creamapi V4.5 working on proton not working 5

update warhammer when you run from proton. its crash about 1 hour later but native not like that.
In native feral browser opening.

and can you delete issue pls.


Asynchronous module hooks

This makes it possible for module hooks to be asynchronous.
My immediate use case for this is that the only way to do an asynchronous action in a mocha beforeEach hook is to return a promise from said hook.
I'm submitting corresponding PRs to ember-mocha and ember-qunit.

:+1:


[oui-timepicker] Disabled attribute does not work

Description
According to the documentation of the component (https://ovh.github.io/ovh-ui-kit/?path=/docs/design-system-components-timepicker-webcomponent--default), the oui-timepicker component does have a disabled attribute. However, it seems that it is not taken into account as we are still able to modify the inputs.
Steps to reproduce
Have a oui-timepicker with a disabled attribute:
html file:
 <oui-timepicker
    model="$ctrl.timepickerModel"
    format="H:i"
    inline
    disabled="$ctrl.timepickerdisabled"
></oui-timepicker>

controller:
this.timepickerModel = '00:15:20';
this.timepickerdisabled = true;

Expected behavior:
Inputs in the timepicker's generated template should be disabled.
Actual behavior:
Inputs are not disabled:

Frequency:
5 (always)

Issue fixed.


readme issue

The readme instructs to install "gem install hirb" ... but, should be "gem install hirber".  Thanks for this branch, it resolved the 2.7.2 issues I was having with Hirb.

Im not sure I'm correct with "gem install hirber".  It successfully installed, but table views are standard irc, not nice like the old HIRB.

Having the same issue. In rails the tables for AR objects do not work.

Having the same issue. In rails the tables for AR objects do not work.

@atstockland @panaak Thanks for the feedback. I haven't really touched the content README, aside from adding a preface section. Name of the gem is changed, so one should use name hirber in both Gemfiles or using gem install ....
I am guessing the problem is, that the main gem entry file is still named hirb, so even though you need to install gem called hirber, you still need to require "hirb". This should be fixed.
In order get things going try to do the following:
require "hirb"
Hirb.enable
extend Hirb::Console

I also usually add the following to my .irbrc because I like to have tables made using unicode characters. This should not be necessary in order to get the things going though. Without this you should still get regular ASCII tables.
%w[ActiveRecord::Base Hash Array].each do |klass|
  Hirb::Formatter
    .dynamic_config[klass] = {
      class: Hirb::Helpers::AutoTable,
      ancestor: true,
      options: { unicode: true },
    }
end

It it doesn't seem to work while also using pry resp. https://github.com/rweng/pry-rails
Without pry it works no problem. Any idea why? Can't investigate myself at this point.

Try running console using pry-rails, then do:
require "hirb"
Hirb.enable
extend Hirb::Console
table [[1, 2], [2, 3]]

Does this produce a table?

Yes, it does.
[10] pry(main)> table [[1, 2], [2, 3]]
┌───┬───┐
│ 0 │ 1 │
├───┼───┤
│ 1 ╎ 2 │
│ 2 ╎ 3 │
└───┴───┘
2 rows in set
=> true
[11] pry(main)>

I've released 0.8.2 version of the gem. The name was changed to "hirber", so there is no need for explicte require anymore. I've also updated the instruction in the README. I am planning a bigger update to the Readme, but I still need to fix some minor bugs first.

@panaak I don't really use pry-rails so I don't know the internals. Getting the tables by default in pry probably requires future development. If you wish make a separate issue. I might look into this in the future.


the return values of GP.predict() in utility_function.utility are nearly the same, with one constraint and 5 parameters optimization problem.

Hi, as described above, here is my excuteable code:
import numpy as np
from bayes_opt import BayesianOptimization,UtilityFunction
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import mlab
from matplotlib import gridspec
from scipy.optimize import NonlinearConstraint
utility = UtilityFunction(kind="ucb", kappa=5, xi=0.0,kappa_decay=0.9)

def constraint_function(xA,xB,yA,yB,yC):
    if yC-yB>0 and yC-yA>0:
        return 1
    return 0
constraint =  NonlinearConstraint(constraint_function, 0.5, np.inf)
bo = BayesianOptimization(
    f=None,
    constraint=constraint,
    pbounds={'xA':(2,18.33), 'yA':(2,27.42),'xB':(2,18.33), 'yB':(2, 18.28),'yC':(2,27.42)},
    verbose=1, # verbose = 1 prints only when a maximum is observed, verbose = 0 is silent
    random_state=2,
)
bo.register(
    params={'xA': 9.119796751978921, 'xB': 2.6590448130649977, 'yA': 15.972420187676788, 'yB': 9.087048551825548, 'yC': 12.685749529063973},
    target=-0.813,
    constraint_value=0,
  )
bo.register(
    params={'xA':17.7220,'xB':10.0307,'yA':17.7807,'yB':13.0734,'yC':21.8929},
    target=-0.981012172,
    constraint_value = 1
)
bo.register(
    params={'xA':7.1483,'xB':4.1982,'yA':13.5641,'yB':6.092,'yC':14.2755},
    target=-1.641490955,
    constraint_value = 1
)
bo.register(
    params={'xA':12.6114,'xB':4.1817,'yA':16.7396,'yB':7.545,'yC':16.7396},
    target=-1.160095298,
    constraint_value = 1
)
bo.register(
    params={'xA':12.1304,'xB':8.1365,'yA':18.28,'yB':2.4142,'yC':18.28},
    target=-1.160498896,
    constraint_value = 1
)
bo.register(
    params={'xA':13.4332,'xB':1.2516,'yA':14.6281,'yB':16.9353,'yC':16.9353},
    target=-1.216274594,
    constraint_value = 1
)
next_point_to_probe = bo.suggest(utility)
print("Next point to probe is:", next_point_to_probe)

I use debug to step into the function suggest in Bayesian_optimization.py and step into function acq_max in line 226, namely
 suggestion = acq_max(ac=utility_function.utility,
                             gp=self._gp,
                             constraint=self.constraint,
                             y_max=self._space.target.max(),
                             bounds=self._space.bounds,
                             random_state=self._random_state)

where I found the ys array with all the same value like:
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
0.108471
...
I am not familiar with the sklearn GPR codes, is there any parameters to be changed or any logic errors with my codes?

Hi @xmaww,
I can take a detailed look later this week, but just to get you started, I am noticing that you are not using the constrained optimization correctly. Please look at the comments I left on your other post #402 again, to make sure that that part is working. It might also help to have a look at the constrained optimization notebook.

Hi @xmaww,
I did some digging and it seems that this can happen if your data changes too rapidly/is too noisy. However, I tried the solutions outlined there regarding adding a WhiteKernel and couldn't get that to work. I also tried modifying the nu parameter of the kernel.
I think this is a bug on scikit-learn's end, so it might be more appropriate to make a bug report there using a fitting short, self-contained, correct example.

Hi @till-m ， I looked into the _gpr.py and I find out the exact place that caused the same values in ys :
      optima = [
                (
                    self._constrained_optimization(
                        obj_func, self.kernel_.theta, self.kernel_.bounds
                    )
                )
            ]

I found that this function is used to optimize the kernel instance of the GPR model in our BayesianOptimization class, and it can change the value of length_scale of the  gp.kernel_.
As I mentioned above, if I annotation data in the line 46 of my codes, the length_scale after the **optima ... ** process goes to 1.76(default value is 1), while if I don't annotation the line 46, the length_scale after the **optima ... ** process goes to 1e-5(which is the lower bounds of the parameter length_scale_bounds in the class kernel of the kernel.py in sklerarn/gaussian_process. )
And I modified the default para of length_scale_bounds from (1e-5, 1e5) to (1, 10)
and I found that the ys did changed (but slightly).
These are my current findings, it is hard for me to dig deep into the optimization of the kernel parameters in _gp.py since I haven't get enough prior knowledge of GPR and the kernel methods.

Hey @xmaww,
I spent some more time on this yesterday evening and basically came to the same conclusion: The parameter estimation in the gp kernel goes wrong for some reason. As a result the kernel matrix ends up being zero everywhere except where it's calculated between the identical points and the GP predicts the mean everywhere. I'm not entirely sure what causes the collapse and it might be better to ask the sklearn folks. I'm not super familiar with how the parameter estimation is done in practice either, except that it uses some maximum-likelihood scheme.
My apologies for not being of more help.

Hi
Once you need to start messing around with kernels, you can be in for quite a deep dive. the sklearn documentation is quite good but it's certainly a detailed topic.
With that said, I've posted below an example of constructing a custom kernel, which importantly uses a dedicated per-parameter length scale. I've found this works well for quite a range of data with my work.
I've also previously incorporated a white kernel with success, there is a write up of that here.
Can you let me know if either of these custom kernels improve your problem (I'm struggling to understand what constitutes 'working' here!).
Another very useful thing to do with the GP is to ask it to predict points that it has already seen. Since this should be trivial, it's a good way to diagnose when something is really going wrong with the kerenl/ fitting.
from bayes_opt import BayesianOptimization,UtilityFunction
from sklearn.gaussian_process.kernels import Matern
# nb: I've skipped the data definition step for conciseness; copy this in from the code above

def derive_length_scales(bounds: dict, length_scale_delta: float = 0.1):
    """
    :param bounds: your instance of pbounds
    :param length_scale_delta: controls the length scale; default as length scale set to 10% of bounds for each parameter
    :return: bayes_length_scales
    """
    ParameterNames = sorted(bounds.keys())
    bayes_length_scales = []
    for paramter_name in ParameterNames:
        length_scale_temp = (bounds[paramter_name][1] - bounds[paramter_name][0]) * length_scale_delta
        bayes_length_scales.append(length_scale_temp)

    return bayes_length_scales

_bounds = {'xA':(0,18.33), 'yA':(0, 18.28),'xB':(0,18.33), 'yB':(0, 18.28),'yC':(9.14,27.42)}
_length_scales = derive_length_scales(_bounds)
_kernel = Matern(length_scale=_length_scales, nu=1.5)
bo = BayesianOptimization(
    f=None,
    pbounds=_bounds,
    verbose=2, # verbose = 1 prints only when a maximum is observed, verbose = 0 is silent
    random_state=4,
    allow_duplicate_points=False)

bo.set_gp_params(normalize_y=True, kernel=_kernel, n_restarts_optimizer=20, alpha=5)
utility = UtilityFunction(kind="ucb", kappa=2.5, xi=0.0)

for params, target_value in zip(initial_params, intial_target_values):
    bo.register(
        params=params,
        target=target_value,
    )

    next_point_to_probe = bo.suggest(utility)
    print("Next point to probe is:", next_point_to_probe)
    print(next_point_to_probe['yC'] - next_point_to_probe['yA'])
    print(next_point_to_probe['yC'] - next_point_to_probe['yB'])

I guess one other thing: can you tell us about your data? do you expect it to be very noisy/ non-smooth?

嘿，
昨天晚上我花了一些时间，基本上得出了相同的结论：gp 内核中的参数估计由于某种原因出错了。结果，核矩阵最终在任何地方都为零，除非它在相同点之间计算并且 GP 预测了所有点的平均值。我不完全确定是什么原因导致崩溃，最好问问sklearn的人。我也不是很熟悉参数估计在实践中是如何完成的，除了它使用了一些最大似然方案。
我很抱歉没有提供更多帮助。

Hi @till-m Thanks! I will turn to sklearn for further help and go back if I have some other    findings!

Closing for now. Let us know if you have any other issues.

Many thanks! I tried some methods mentioned above I found it actually worked
and the problems I faced have been solved. @bwheelz36 ,it's so sorry that I haven't try your advice with a really tight schedule and I will turn to your suggestions after this period  of time!


invalid powermetrics option specified

After installing and running asitop, I receive the following output:
(base) aarcross@Aarons-MacBook-Pro ~ % asitop
[1/3] Loading ASITOP
[2/3] Starting powermetrics process
[3/3] Waiting for first reading...
Password:
powermetrics: invalid option -- u
Usage: powermetrics [-i sample_interval] [-r order] [-t wakeup_cost]
Gather and display CPU usage statistics (divided into time spent in
user mode and supervisor mode), timer and interrupt wakeup frequency
(total and, for near-idle workloads, those that resulted in package
.
.
.
Machine model: MacBookPro18,1
OS version: 21A559
Boot arguments:
Boot time: Fri Oct 29 21:26:43 2021

I solved the problem by changing the output_file_flag from -u to -o in line 49 in the utils.py file. I think there is some Problem with checking the Version of the OS system that is running.

I solved the problem by changing the output_file_flag from -u to -o in line 49 in the utils.py file. I think there is some Problem with checking the Version of the OS system that is running.

Thanks, this solved the issue for me, too!


Added rewind and seek functions

As the title says I added rewind and seek functions.

https://github.com/vikmeup/Player/commit/f15c599060953d07dfcb076497cd77c5bee91a97

I think this could be closed, since this merged: https://github.com/vikmeup/Player/commit/f15c599060953d07dfcb076497cd77c5bee91a97


Dockerfiles grammar

Dockerfiles have their own syntax and right now the main parsing logic and AST related things have been implemented in builder/parser/parser.go. I think that there has been made a pretty good job but I thought that the same thing can be accomplished with a context free grammar that can be converted into a LR parser written in go.
This would make the parser more readable and would help a lot in debugging and maintaining/adding new features thanks to the fact that it would need a half of the actual code and as its simplicity can give a real help creating the AST.
What do you think?

see https://github.com/docker/docker/issues/12221

closing as duplicate

the conversation can continue there :)


Parser net connector logging is turned off due to performance

Last testing showed significant performance reduction when received data was logged to file.  It has been turned off in code until the rolling append is fixed or changed to use log4J or something faster.

updated the logging to use log4j standard logging - working fine.  added rolling file appender to change logs every 5 mins.


Add data attribute to DOM element-container to identify the page index

Per https://github.com/hypothesis/h/blob/document-pdfjs/docs/internals/pdfjs.rst#getting-the-root-dom-node-for-the-text-layer-of-a-page, add a 'data-' attribute to allow query selector operation and for identifying which page element-container belongs to. 'data-page-id' will work.
/cc @csillag

I can confirm that this would make integration between PDF.js and other projects (like Hypothes.is) easier.

So I made the change that is required in pdf_page_view.js to add the attributes. Take a look at the following commit: https://github.com/mbbaig/pdf.js/commit/f8c25ba257ff51f415388fd828cdd6941b764ad8
Here is a screen shot to illustrate the result:

This was the intent right?

yes, it is. To not confuse people, we probably need to change"data-page-id" to "data-page-index" for 0..n-1 numbers or to "data-page-number" for 1..n numbers. The latter seams to be more logical.

updated the code to reflect requirements. https://github.com/mbbaig/pdf.js/commit/7682d0cb80839a6c0a207d100f58adf0debb95e2

Fixed in #5881.


CSGO: Add Certificate Reissuance

This PR adds certificate reissuance to the infrastructure. (#1183)
Core ASes periodically renew leaf AS and issuer AS certificates.
Non-Core ASes periodically request new certificate chains from their
responsible core AS.
Both these tasks are done on the Certificate Server
Request must be verifiable with the newest verifying key in the
customer mapping of the core AS.
The non-core Certificate Servers start to automatically request
reissued certificate chains one path segment validity time before
expiration to provide optimal coverage.
The reissued certificate chains are disseminated by the Beacon server.
They start polling the certificate server for new certificate chains
when the available certificate no longer covers the desired segment
validity period.
Missing:
Useful integration test

This change is

Reviewed 7 of 8 files at r1.
Review status: 7 of 8 files reviewed at latest revision, all discussions resolved, some commit checks failed.

go/cert_srv/io.go, line 109 at r1 (raw file):

			return common.NewBasicError("Unable to unpack cert_mgmt union", err)
		}
		switch pld.(type) {

This can be simplified a bit:
		switch pld := pld.(type) {
		case *cert_mgmt.ChainIssReq:
			d.reissHandler.HandleReq(addr, pld, signed, config)
		case *cert_mgmt.ChainIssRep:
			d.reissHandler.HandleRep(addr, pld, config)
		case *cert_mgmt.Chain:
			d.chainHandler.HandleRep(addr, pld, config)
		case *cert_mgmt.ChainReq:
			d.chainHandler.HandleReq(addr, pld, config)
		case *cert_mgmt.TRC:
			d.trcHandler.HandleRep(addr, pld, config)
		case *cert_mgmt.TRCReq:
			d.trcHandler.HandleReq(addr, pld, config)

It's a common idiom in Go.

go/cert_srv/reiss_handler.go, line 21 at r1 (raw file):

	"time"

	log "github.com/inconshreveable/log15"

Use github.com/scionproto/scion/go/lib/log instead now (see https://github.com/scionproto/scion/pull/1546 for context).

go/cert_srv/reiss_handler.go, line 40 at r1 (raw file):

// automatically by the issuer ASes.
type ReissHandler struct {
	conn *snet.Conn

As config *conf.Conf is a parameter for most methods in this type, what about just adding it to the ReissHandler struct?

go/cert_srv/reiss_handler.go, line 80 at r1 (raw file):

		}
		return
	}

There should be a check to ensure that maxChain == crt.Version -1, otherwise a customer can request any version they like.

go/cert_srv/reiss_handler.go, line 106 at r1 (raw file):
The comment where this is called says:

// Verify the request was correctly signed by the requester

Which is subtly different to this comment/implementation. Suggestion: rename it to validateSign, that way it's clearer that it's not doing signature verification (as you pointed out, that's already done by the dispatcher).

go/cert_srv/reiss_handler.go, line 116 at r1 (raw file):

	if err != nil {
		return nil, err
	}

There's a check missing: src.IA.Eq(addr.IA). Actually, this should be done in Dispatcher.dispatch().

go/cert_srv/reiss_handler.go, line 117 at r1 (raw file):

		return nil, err
	}
	verChain, err := config.GetVerifier().(*SigVerifier).getChainForSign(src)

This is a bit awkward. Skimming the code of getChainForSign, it looks like it doesn't access the parent type at all. That sounds like an opportunity to move it to a standalone function, which would also make this use cleaner.

go/cert_srv/reiss_handler.go, line 122 at r1 (raw file):

	}
	if signed.Sign.Type.String() != verChain.Leaf.SignAlgorithm {
		return nil, common.NewBasicError("Invalid sign type", nil, "type", signed.Sign.Type)

Always log what the expected value was, too. "expected", verChain.Leaf.SignAlgorithm, "actual", signed.Sign.Type).

go/cert_srv/reiss_handler.go, line 134 at r1 (raw file):

// validateReq validates the requested certificate. Additionally, it validates that
// the request was verified with the same verifying key as in the customer mapping.
func (h *ReissHandler) validateReq(c *cert.Certificate, key common.RawBytes,

vKey would match the naming in issueChain, and make it a bit easier to follow. Maybe vChain too, for the same reason.

go/cert_srv/reiss_handler.go, line 172 at r1 (raw file):

		chain.Leaf.ExpirationTime = chain.Issuer.ExpirationTime
	}
	if err = chain.Leaf.Sign(config.GetIssSigningKey(), crypto.Ed25519); err != nil {

crypto.Ed25519 - can this be replaced with something like chain.Issuer.SignAlgorithm?

go/cert_srv/reiss_handler.go, line 197 at r1 (raw file):

	}
	log.Info("Send reissued certificate chain", "chain", chain, "addr", addr)
	return SendPayload(h.conn, cpld, addr)

Would it make sense to sign the response too?

go/cert_srv/reiss_handler.go, line 228 at r1 (raw file):

}

// validateRep validates that the received certificate chain can be added to the trust store.

Is the signature on the new cert verified anywhere?

go/cert_srv/conf/conf.go, line 35 at r1 (raw file):

const (
	// LeafReissTime is the default value for Conf.LeafReissTime. It is the same
	// as the default segment TTL in order to provide optimal coverage.

The segment TTL is a per-AS configuration choice. It's the PathSegmentTTL value in as.yml.

python/beacon_server/base.py, line 785 at r1 (raw file):

            diff = exp - int(time.time())
            if diff > self.config.segment_ttl:
                time.sleep(max(0, diff - self.config.segment_ttl))

I don't think the max() is necessary, the if condition already covers that.

Comments from Reviewable

Review status: 0 of 11 files reviewed at latest revision, 14 unresolved discussions.

go/cert_srv/io.go, line 109 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
This can be simplified a bit:
		switch pld := pld.(type) {
		case *cert_mgmt.ChainIssReq:
			d.reissHandler.HandleReq(addr, pld, signed, config)
		case *cert_mgmt.ChainIssRep:
			d.reissHandler.HandleRep(addr, pld, config)
		case *cert_mgmt.Chain:
			d.chainHandler.HandleRep(addr, pld, config)
		case *cert_mgmt.ChainReq:
			d.chainHandler.HandleReq(addr, pld, config)
		case *cert_mgmt.TRC:
			d.trcHandler.HandleRep(addr, pld, config)
		case *cert_mgmt.TRCReq:
			d.trcHandler.HandleReq(addr, pld, config)

It's a common idiom in Go.

Done.

go/cert_srv/reiss_handler.go, line 21 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Use github.com/scionproto/scion/go/lib/log instead now (see https://github.com/scionproto/scion/pull/1546 for context).

Done.

go/cert_srv/reiss_handler.go, line 40 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
As config *conf.Conf is a parameter for most methods in this type, what about just adding it to the ReissHandler struct?

I wanted to keep it consistent with the other handlers.
I'm not sure what the correct behavior is during a config reload.
Currently, the same config is used when handling requests, even if a update happens.

go/cert_srv/reiss_handler.go, line 80 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
There should be a check to ensure that maxChain == crt.Version -1, otherwise a customer can request any version they like.

Added to validteReq.
Done.

go/cert_srv/reiss_handler.go, line 106 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
The comment where this is called says:

// Verify the request was correctly signed by the requester

Which is subtly different to this comment/implementation. Suggestion: rename it to validateSign, that way it's clearer that it's not doing signature verification (as you pointed out, that's already done by the dispatcher).

Done.

go/cert_srv/reiss_handler.go, line 116 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
There's a check missing: src.IA.Eq(addr.IA). Actually, this should be done in Dispatcher.dispatch().

Done.

go/cert_srv/reiss_handler.go, line 117 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
This is a bit awkward. Skimming the code of getChainForSign, it looks like it doesn't access the parent type at all. That sounds like an opportunity to move it to a standalone function, which would also make this use cleaner.

Done.

go/cert_srv/reiss_handler.go, line 122 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Always log what the expected value was, too. "expected", verChain.Leaf.SignAlgorithm, "actual", signed.Sign.Type).

Done.

go/cert_srv/reiss_handler.go, line 134 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
vKey would match the naming in issueChain, and make it a bit easier to follow. Maybe vChain too, for the same reason.

Done.

go/cert_srv/reiss_handler.go, line 172 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
crypto.Ed25519 - can this be replaced with something like chain.Issuer.SignAlgorithm?

Done.

go/cert_srv/reiss_handler.go, line 197 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Would it make sense to sign the response too?

Done.
(Although, currently this signature is ignored to avoid deadlocks. The trust store needs to support recursive look ups)

go/cert_srv/reiss_handler.go, line 228 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Is the signature on the new cert verified anywhere?

Done.
Issuer verifies signature
Requester checks chain is verifiable.

go/cert_srv/conf/conf.go, line 35 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
The segment TTL is a per-AS configuration choice. It's the PathSegmentTTL value in as.yml.

Done.

python/beacon_server/base.py, line 785 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
I don't think the max() is necessary, the if condition already covers that.

Done.

Comments from Reviewable

Reviewed 13 of 13 files at r2.
Review status: all files reviewed, 4 unresolved discussions (waiting on @kormat and @Oncilla)

go/cert_srv/io.go, line 83 at r2 (raw file):

}

// dispatch hands payload over tho the associated handlers.

s/tho/to/

go/cert_srv/reiss_handler.go, line 40 at r1 (raw file):
Previously, Oncilla wrote…
I wanted to keep it consistent with the other handlers.
I'm not sure what the correct behavior is during a config reload.
Currently, the same config is used when handling requests, even if a update happens.

How we handle this in the BR is that at the start of a request the handler grabs a pointer to the current config, and uses that for the current request. A config reload then just changes the shared pointer to point to a new version of the config, and all future requests will use that.
So, yeah, either you create a new ReissHandler per request, or you pass the config into methods like you do currently.

go/cert_srv/reiss_handler.go, line 106 at r1 (raw file):
Previously, Oncilla wrote…
Done.

Old name still in docstring.

go/cert_srv/reiss_tasks.go, line 38 at r2 (raw file):

// Run periodically issues certificate chains for the local AS.
func (l *SelfIssuer) Run() {

How did SelfIssuer end up with a receiver var l? :)

Comments from Reviewable

Review status: all files reviewed, 4 unresolved discussions (waiting on @Oncilla and @kormat)

go/cert_srv/io.go, line 83 at r2 (raw file):
Previously, kormat (Stephen Shirley) wrote…
s/tho/to/

Done.

go/cert_srv/reiss_handler.go, line 40 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
How we handle this in the BR is that at the start of a request the handler grabs a pointer to the current config, and uses that for the current request. A config reload then just changes the shared pointer to point to a new version of the config, and all future requests will use that.
So, yeah, either you create a new ReissHandler per request, or you pass the config into methods like you do currently.

Hmm, that's a bit inconclusive. What route should we take?
I prefer consistency, if we create a new handler for each request, I will do that for every other handler as well.
(Similar to what lib/infra is doing.)
This also begs the question, will we adapt the CS to use lib/infra at some point?

go/cert_srv/reiss_handler.go, line 106 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Old name still in docstring.

Done.

go/cert_srv/reiss_tasks.go, line 38 at r2 (raw file):
Previously, kormat (Stephen Shirley) wrote…
How did SelfIssuer end up with a receiver var l? :)

Struggling for a good name and constant renaming will do that ;)
l->s for SelfIssuer
l->r for ReissueRequester

Comments from Reviewable

Reviewed 4 of 4 files at r3.
Review status: all files reviewed, 1 unresolved discussion (waiting on @Oncilla)

go/cert_srv/reiss_handler.go, line 40 at r1 (raw file):
Previously, Oncilla wrote…
Hmm, that's a bit inconclusive. What route should we take?
I prefer consistency, if we create a new handler for each request, I will do that for every other handler as well.
(Similar to what lib/infra is doing.)
This also begs the question, will we adapt the CS to use lib/infra at some point?

Ok, let's keep the current approach, for now at least.
Re: lib/infra, yep, that is the plan when lib/infra is a bit more fleshed-out.

Comments from Reviewable


[Things] Tags not applying to new todo

Extension
https://www.raycast.com/loris/things
Raycast Version
v1.79.1
macOS Version
13.4 (22F66)
Description
I use Raycast to quickly enter tasks into Things. Although the task is created, the selected tags aren't being applied to the task.
Steps To Reproduce

Use "Add New To Do" command
Create a task with at least one tag
View task in Things

Current Behaviour
No tags are on the task
https://github.com/user-attachments/assets/5fa8d927-c486-4e52-8d1b-e5e1d143eeeb
Expected Behaviour
Tags on the task

The problem is with this logic:
https://github.com/raycast/extensions/blob/257807cc39a228f0775ca962136bb796008a8068/extensions/things/src/add-new-todo.tsx#L51-L55
If we select tags tag1 and tag2, then after qs.stringify(json) the deep link becomes
things:///add?tags%5B0%5D=tag1&tags%5B1%5D=tag2

because that's how qs.stringify converts ["tag1", "tag2"]. Instead, from the playground, it seems the required deep link should be in the format
things:///add?tags=tag1%2Ctag2

which is what we get if we join the tags array with ,, so ["tags1", "tags2"].join(",").


[in_app_purchase_storekit] StoreKit2 call completePurchase() await forever

Steps to reproduce

enable Storekit2

InAppPurchaseStoreKitPlatform.enableStoreKit2();

make a product purchase and get a PurchaseDetails in _listenToPurchaseUpdate() callback

 Future<void> _handleReportedPurchaseState(PurchaseDetails purchaseDetails) async {
      ...
      ...

      if (purchaseDetails.pendingCompletePurchase) {
        await _iapStoreKitPlatform.completePurchase(purchaseDetails);
      }
    }
  }

You will find completePurchase() never finish and await is forever 😅

Expected results
await completePurchase() should return or throw exception
Actual results
await completePurchase() never return forever!
Code sample
Default sample code is enough
https://github.com/flutter/packages/blob/main/packages/in_app_purchase/in_app_purchase_storekit/example/lib/main.dart
Screenshots or Video
No response
Logs
I dig into in_app_purchase_storekit plugin native code, and find some clue about this issue:
Check this code
  /// Wrapper method around StoreKit2's finish() method https://developer.apple.com/documentation/storekit/transaction/3749694-finish
  func finish(id: Int64, completion: @escaping (Result<Void, Error>) -> Void) {
    Task {
      let transaction = try await fetchTransaction(by: UInt64(id))
      if let transaction = transaction {
        await transaction.finish()
      }
    }
  }

⚠completion closure was never used in finish(id:completion:)⚠
Flutter Doctor output
Doctor output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.5, on macOS 15.2 24C101 darwin-arm64, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.95.3)
[✓] Connected device (5 available)
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

@LouiseHsu Please check it, Thanks!

Thanks for the report. Using the code sample provided, I was able to replicate the reported behavior. It gets stuck at below:
https://github.com/flutter/packages/blob/cbdb48a0bcee5865e6e5d29826d6f44cc1f0984d/packages/in_app_purchase/in_app_purchase_storekit/example/lib/main.dart#L241


Marking flow as PREPARING from DISPATCHING as POD creation request is submitted

Pull Request Test Coverage Report for Build 5900

0 of 0   changed or added relevant lines in 0 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage increased (+0.003%) to 43.613%

Files with Coverage Reduction
New Missed Lines
%

azkaban-exec-server/src/main/java/azkaban/container/FlowContainer.java
1
16.73%

Totals

Change from base Build 5885:
0.003%

Covered Lines:
15208

Relevant Lines:
34870

💛  - Coveralls


Updating trunk.yml for Testing framework

Linked Issue: Closes #110

Checklist:

[x] Did you sign the Contributor License Agreement?
[x] Is the linter reporting 0 errors?
[ ] Does the CI pipeline pass?

We should verify that this builds such that @testable actually works.

Isn't the last thing to do on this just a quick verification that @testable works?

Isn't the last thing to do on this just a quick verification that @testable works?

No, if I remember correctly, the build command in build-frameworks.sh will need to be different for the testing package. I believe the last thing I was doing was trying to find the right build call and encountering the error above

So this has moved forward some, but not all the way. The build-xcframework.sh script is still failing, I believe now, due to the wrong path being used to copy the modules or frameworks.

This will not work as expected. The reason is we're using xcodebuild not swift build for creating the xcframework.
I've tried to look it up and was sorely disappointed: developer.apple.com/forums/thread/125921

This also seems related, but similarly doesn't seem to provide the answer we want. It has some responses from DTS, but our use case might not be supported.

It sounds like this is not something we will be following through on due to the xcodebuild / swift build differences. I plan to close this PR and the associated issue.


Peer awareness documentation - peers connecting to each other by at-least one edge

The following statement in the docs under - Peer awareness - looks incorrect.

You can add multiple peers to a system, and as long as they are all connected to each other by at least one edge, they will synchronize the registrations amongst themselves.

Peers connecting to each other by at-least one edge is not sufficient. Consider the below scenario.

Ran 3 eureka servers with following configurations. (on peer aware mode - peers connected to each other by one edge ). server.list below is referred by the defaultZone.

java -Dport=7776 -Dhostname=primary-host   -Dserver.list=http://secondary-host:7777/eureka -jar discovery-eureka-server.jar
java -Dport=7777 -Dhostname=secondary-host -Dserver.list=http://tertiary-host:7778/eureka  -jar target/discovery-eureka-server.jar
java -Dport=7778 -Dhostname=tertiary-host  -Dserver.list=http://primary-host:7776/eureka   -jar target/discovery-eureka-server.jar

This was resulted in one DS replica on each peer.

Once all the eureka servers are up, deployed a client. The client connects to the first server in the list.

java -Dport=8891 -Dhostname=forth-host -Dserver.list=http://primary-host:7776/eureka,http://secondary-host:7777/eureka,http://tertiary-host:7778/eureka -jar discovery-eureka-client.jar

However the client was reflected only in primary and secondary servers, but not in the tertiary server. Therefore each eureka server must be configured with all the other peers? Also I need some clarity on how does the replication happens after startup. And during startup it's not clear how each eureka server replicates the complete registry from all the associated peers.

Digging deeper into this reveled few more facts.
Registry replication during startup

Eureka server has both client (DiscoveryClient) and server roles.
During startup the DiscoveryClient fetches the registry information from the first node in the serviceUrl list.
If it could not connect to first server, falls-back to the next server in the serviceUrl list. (i.e. by RetriableEurekaHttpClient)
This means it does not fetch from all the servers in serviceUrl list. This is common to all eureka clients.
Then the eureka server registers each application instance (i.e. registry info fetched above) with itself
If it could not register at-least one app instance, it will wait for 30 seconds (default) and retries the same for 5 times.
After all the retries, if it could not register at-least one app instance, then the server will not let it's clients to get the delta registry from 5 mins.

Registry replication after startup

Once a server starts-up, its does not fetch registry information from neighboring peers, instead each eureka server broadcasts all the operations to peer nodes. (see PeerAwareInstanceRegistryImpl::replicateToPeers)
Broadcast of operations does not happen at pre-configured intervals, but as soon the operation succeeds at a server
These operations are not retried.

The self url in the serviceUrl list

The serviceUrl for servers can have the self url as well because the self-host is not registered as a DS replica, hence self-replication never happens. This means following configuration is valid and enables us to maintain a static list of serviceUrls on config server.

---
spring:
  profiles: peer1
eureka:
  instance:
    hostname: peer1
  client:
    serviceUrl:
      defaultZone: http://peer1/eureka/,http://peer2/eureka/

---
spring:
  profiles: peer2
eureka:
  instance:
    hostname: peer2
  client:
    serviceUrl:
      defaultZone: http://peer1/eureka/,http://peer2/eureka/

However during startup it will result in java.net.ConnectionException: connection refused if self host is the very first in the serviceUrl list - when the DiscoveryClient trying to connect. However this not an issue - see DiscoveryClient behavior above.

Closing since this has already been addressed. I was referring to an older doc version.


Fix iOS 9 radio issue in UIWebView

Actually there's a problem here. e.preventDefault seems to stop Meteor app events from firing


PromptLayerOpenAI not working in Sequential Chain

I have a chain that's like

llm1 = PromptLayerOpenAI()
chain1 = LLMChain(llm=llm, prompt=prompt, output_key="answer1")
llm2 = OpenAI()
chain2 = LLMChain(llm=llm, prompt=prompt, output_key="answer2")
full_chain = SequentialChain(
chains=[chain1, chain2],
input_variables=["query"],
output_variables=["answer1, "answer2"]
full_chain({"query": "query"})

My api keys are set up properly but it seems like that full_chain call isn't actually running through PromptLayerOpenAI. The chain is running successfully but seemingly not calling the PromptLayerOpenAI _generate
I really like what you guys are building and trying to build something that'd be compatible with it so hopefully can work this out

nvm realized the issue was I was trying to use gpt-3.5-turbo and should have been initializing a PromptLayerOpenAIChat instead


Allow serializing of integer zero

Fixes #758
The parsing and measuring code didn't have explicit handling for integer zero, and the while(v > 0) loop wouldn't execute.
Also add tests to cover both of these cases.

Merged in https://github.com/boostorg/url/commit/f06f595ae760b6626764b8a01e3f8197b4016d6f