copy node_ordering_by_rack.py

TASK [rack-aware : copy node_ordering_by_rack.py] ******************************
fatal: [inst-e6vvd-watch-tower]: FAILED! => changed=false
checksum: 5c124431f0167c446ee6f7cb89d99c4918d594a6
gid: 1000
group: opc
mode: '0664'
msg: chgrp failed
owner: opc
path: /opt/oci-hpc/bin/node_ordering_by_rack.py
size: 3005
state: file
uid: 1000
fatal: [inst-e4wkl-watch-tower]: FAILED! => changed=false
checksum: 5c124431f0167c446ee6f7cb89d99c4918d594a6
gid: 1000
group: opc
mode: '0664'
msg: chgrp failed
owner: opc
path: /opt/oci-hpc/bin/node_ordering_by_rack.py
size: 3005
state: file
uid: 1000

TASK [rack-aware : copy node_ordering_by_rack.py] ******************************
fatal: [inst-e6vvd-watch-tower]: FAILED! => changed=false
checksum: 5c124431f0167c446ee6f7cb89d99c4918d594a6
gid: 1000
group: opc
mode: '0664'
msg: chgrp failed
owner: opc
path: /opt/oci-hpc/bin/node_ordering_by_rack.py
size: 3005
state: file
uid: 1000
...ignoring

@steven-basart
Would you be able to explain what is going on here please?

Old bug that I think has been fixed (not by me probably during one of the upgrades). Wherever I encounter a bug I make an issue. This was one of them. It occurred the rack aware role.

@steven-basart
Any means to reproduce or can we close?

To reproduce we just need to see which play book calls the "rack-aware" task and see if it succeeds now.

@steven-basart
This task is run by the resize script. We've run resize multiple times since March when this issue was created. I've also noticed that the permissions in the rack-aware role have been changed from 644 to 755.
I created a simple playbook to execute the rack-aware role to test whether the copy play works correctly:
- hosts: bastion
  roles:
    - rack-aware

The playbook ran successfully:
PLAY RECAP *********************************************************************
watch-tower-bastion        : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0

I think we are good to close this issue.

@steven-basart
I also ran the same playbook but on all compute nodes instead of just the bastion node:
PLAY RECAP *********************************************************************
inst-1izto-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-3lkhl-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-4550h-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-4aqno-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-7vnv6-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-aa2un-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-alr3c-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-bmccd-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-cpqls-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-e6vvd-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-encjw-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-evoyb-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-fnbev-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-fwhck-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-gp7wn-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-hgqwx-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-hsfgo-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-mdqbh-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-necvh-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-nfanw-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-qj9qc-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-rbxtc-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-rk4hy-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-u90mk-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-ul7as-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-umizk-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-unr7l-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-wzlds-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-xydnk-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-ysctj-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
inst-yum8n-watch-tower     : ok=5    changed=1    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0

@steven-basart
TASK [rack-aware : copy node_ordering_by_rack.py] **********************************************************************************************************************************************************************************************
ok: [inst-cpqls-watch-tower]
ok: [inst-alr3c-watch-tower]
ok: [inst-unr7l-watch-tower]
ok: [inst-umizk-watch-tower]
ok: [inst-ysctj-watch-tower]
ok: [inst-encjw-watch-tower]
ok: [inst-ul7as-watch-tower]
ok: [inst-qj9qc-watch-tower]
ok: [inst-fwhck-watch-tower]
ok: [inst-gp7wn-watch-tower]
ok: [inst-xydnk-watch-tower]
ok: [inst-4550h-watch-tower]
ok: [inst-hgqwx-watch-tower]
ok: [inst-rk4hy-watch-tower]
ok: [inst-4aqno-watch-tower]
ok: [inst-evoyb-watch-tower]
ok: [inst-rbxtc-watch-tower]
ok: [inst-fnbev-watch-tower]
ok: [inst-wzlds-watch-tower]
ok: [inst-yum8n-watch-tower]
ok: [inst-7vnv6-watch-tower]
ok: [inst-u90mk-watch-tower]
ok: [inst-nfanw-watch-tower]
ok: [inst-mdqbh-watch-tower]
ok: [inst-e6vvd-watch-tower]
ok: [inst-3lkhl-watch-tower]
ok: [inst-1izto-watch-tower]
ok: [inst-hsfgo-watch-tower]
ok: [inst-bmccd-watch-tower]
ok: [inst-necvh-watch-tower]

LGTM

Resolved. Closing.


data missing with "response.doc" comparing with "PyQuery"

clearly  look at this two pic

Can you upload the images here, in github

i reedit it , plz review the topic
and the test url is:
http://bbs.tigtag.com/forum-48-1.html


perc_mass error for component not in given compound

There should probably be a quick check that the requested sub-element for percentage is actually in the given compound.

more elements than in the compound (H3 in H2O)
element not in compound (Al in H2O)
partial matching of compound (NaSO4 in H2SO4)


Warning: forceUpdate(...): Can only update a mounting component

Hi After updating from react-fluxible-i18n from 1.1.0 to 1.6.0 the following error message is thrown. Notably this happens during the render lifecycle server side on isomorphic applications:
Warning: forceUpdate(...): Can only update a mounting component. This usually means you called forceUpdate() outside componentWillMount() on the server. This is a no-op. Please check the code for the Translate component.

Thank you for reporting that issue. It is now fixed in the latest version.


Feature/vast complete event support

The few other changes that are not related to my original complete event patch where there or did you add them to address other specific issues?

They were changes that already existed in the prod files (found looking at a diff of the compiled js).


Problem parsing VDO fields: online

lvm exporter has trouble parsing some values, and reports 4 errors (but logs just two):
Jun 26 08:31:55 xxx prometheus-lvm-exporter[19726]: 2023/06/26 08:31:55 Scrape failed: 4 error(s) occurred:
Jun 26 08:31:55 xxx prometheus-lvm-exporter[19726]: * field vdo_compression_state: strconv.ParseFloat: parsing "online": invalid syntax
Jun 26 08:31:55 xxx prometheus-lvm-exporter[19726]: * field vdo_index_state: strconv.ParseFloat: parsing "online": invalid syntax
Jun 26 08:32:08 xxx prometheus-lvm-exporter[19726]: 2023/06/26 08:32:08 Scrape failed: 4 error(s) occurred:
Jun 26 08:32:08 xxx prometheus-lvm-exporter[19726]: * field vdo_compression_state: strconv.ParseFloat: parsing "online": invalid syntax
Jun 26 08:32:08 xxx prometheus-lvm-exporter[19726]: * field vdo_index_state: strconv.ParseFloat: parsing "online": invalid syntax

Looks like the test data doesn't contain all VDO fields, so the vdo_compression_state and vdo_index_state fields weren't fully exercised. They're always strings (relevant source code in lib/metadata/vdo_manip.c).
@Garagoth, I'm happy to submit a fix similar to commit c17044b to treat the VDO fields as info instead of metrics. Would you be able to provide me with a raw JSON snippet with real values for use in tests? The command would be as follows (apply sudo, etc. as necessary):
/usr/sbin/lvm lvs --all --config 'global/suffix=false global/units=b report/binary_values_as_numeric=1 report/output_format=json report/buffered=false report/time_format=%s' \
  --configreport lv --options \
  lv_uuid,lv_name,vdo_compression_state,vdo_index_state,vdo_operating_mode,vdo_saving_percent,vdo_used_size

and reports 4 errors (but logs just two)

That's interesting to say the least. prometheus.MultiError uses len() of a slice just before iterating over the same. I can't reproduce your output with simulated data triggering errors.
This might be far-fetched, but is it possible that your logging imposes some sort of rate limitation which would drop two additional lines per scrape failure?

  {
      "report": [
          {
              "lv": [
                  {"lv_uuid":"dylifl-81AF-n2mG-kFKo-Ntxe-mnNQ-3eB7fF", "lv_name":"vpool0", "vdo_compression_state":"online", "vdo_index_state":"online", "vdo_operating_mode":"normal", "vdo_saving_percent":"55.37", "vdo_used_size":"2788999639040"},
                  {"lv_uuid":"r7Btja-nL3P-Co38-X2K4-DLWS-LMhT-LajcQa", "lv_name":"lv_db_backup", "vdo_compression_state":"online", "vdo_index_state":"online", "vdo_operating_mode":"normal", "vdo_saving_percent":"55.37", "vdo_used_size":"2788999639040"},
                  {"lv_uuid":"tHnHR1-bjg8-ycJX-eyhR-heEp-L4qs-S510dO", "lv_name":"[vpool0_vdata]", "vdo_compression_state":"", "vdo_index_state":"", "vdo_operating_mode":"", "vdo_saving_percent":"", "vdo_used_size":""},
                  {"lv_uuid":"5UyOrx-zG6u-w7cF-G2Ny-HmVd-0lsb-4J6lG2", "lv_name":"lv_data", "vdo_compression_state":"", "vdo_index_state":"", "vdo_operating_mode":"", "vdo_saving_percent":"", "vdo_used_size":""},
                  {"lv_uuid":"lGs7Tn-1Fyv-jMHN-aniN-r8qk-duEI-B9Xl9e", "lv_name":"swap", "vdo_compression_state":"", "vdo_index_state":"", "vdo_operating_mode":"", "vdo_saving_percent":"", "vdo_used_size":""},
                  {"lv_uuid":"cqZnVQ-FUPG-btWz-3fff-cMX5-wViK-8MM3QY", "lv_name":"root", "vdo_compression_state":"", "vdo_index_state":"", "vdo_operating_mode":"", "vdo_saving_percent":"", "vdo_used_size":""}
              ]
          }
      ]
  }

My journal logs message that some messages were suppressed when it does that, but nothing here. I pasted above two error logs that are consecutive, nothing in between.

I pushed a commit converting vdo_compression_state and vdo_index_state to info fields. Do you want me to tag a new release?
With your test data the error as of commit 539a714 (HEAD before the aforementioned change) written by the program is as follows:
4 error(s) occurred:
* field vdo_compression_state: strconv.ParseFloat: parsing "online": invalid syntax
* field vdo_compression_state: strconv.ParseFloat: parsing "online": invalid syntax
* field vdo_index_state: strconv.ParseFloat: parsing "online": invalid syntax
* field vdo_index_state: strconv.ParseFloat: parsing "online": invalid syntax

It's possible that duplicate lines are suppressed by logging. I don't have any other explanation for the mismatch.

I've tagged version 0.3.3.

Thanks! Installed, seems to be working fine!


Ensure the java.io.tmpdir actually ends with a '/' character

This fixes an issue with some Operating Systems where System.getProperty("java.io.tmpdir") does not return a path with a trailing separator.
More specifically, I ran into this issue on Gentoo Linux where System.getProperty("java.io.tmpdir") returns "/tmp".
This may be the problem with issue #12.

It probably shouldn't make assumptions, and just use Paths from the JDK.

I'm closing this as it doesn't seem any other part of this project handles paths correctly anyways.


Anonymizer service

This PR currently has failed builds because of inheritdoc errors been thrown by phpcs. These will be reviewed later in the create-anonymizers branch.
This PR adds the anonymizer service which can be used to anonymize objects.

Moved the AnonymizerInterface
Added two new types: (collection|object)
Added unit tests

After my approve, @TomSchillemans pushed a commit that caused build fails. Please fix this issue before merging.


CASMISNT-5501 Add IUF Nexus Helm support

Summary and Scope
Implements the Install Upgrade Framework (IUF) hook for loading Helm charts into Nexus.
Issues and Related PRs

Resolves CASMINST-5501

Testing
This was tested on Mug and on Frigg using the current IUF framework.
Tested on:

Mug
Frigg

Test description:
Tests were run on Mug and Frigg to confirm that Helm content was created by the IUF as expected in Nexus when installing the COS product.
Risks and Mitigations
None.
Pull Request Checklist

[ ] Version number(s) incremented, if applicable
[ ] Copyrights updated
[ ] License file intact
[ ] Target branch correct
[ ] CHANGELOG.md updated
[ ] Testing is appropriate and complete, if applicable
[ ] HPC Product Announcement prepared, if applicable

Jenkins failing to pull GH reference. Trying again
stderr: fatal: couldn't find remote ref refs/pull/16/head


libfmt error

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[6], line 1
----> 1 from projectaria_tools.core import data_provider, mps
      2 from projectaria_tools.core.mps.utils import (
      3     filter_points_from_confidence,
      4     get_gaze_vector_reprojection,
      5     get_nearest_eye_gaze,
      6     get_nearest_pose,
      7 )
      8 from projectaria_tools.core.stream_id import StreamId

File /samsung4tb/conda_envs/projectarea_tools_py311/lib/python3.11/site-packages/projectaria_tools/__init__.py:16
      1 # Copyright (c) Meta Platforms, Inc. and affiliates.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     14
     15 # This makes the modules discoverable when doing dir(projectaria_tools)
---> 16 from . import core  # noqa

File /samsung4tb/conda_envs/projectarea_tools_py311/lib/python3.11/site-packages/projectaria_tools/core/__init__.py:21
      1 # Copyright (c) Meta Platforms, Inc. and affiliates.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     14
     15 # This makes the modules discoverable when doing dir(projectaria_tools.core)
     17 """
     18 A pybind11 binding for projectaria_tools core module
     19 """
---> 21 from . import (  # noqa
     22     calibration,
     23     data_provider,
     24     image,
     25     mps,
     26     sensor_data,
     27     sophus,
     28     stream_id,
     29     vrs,
     30     vrs_health_check,
     31 )

File /samsung4tb/conda_envs/projectarea_tools_py311/lib/python3.11/site-packages/projectaria_tools/core/calibration.py:19
      1 # Copyright (c) Meta Platforms, Inc. and affiliates.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     15 """
     16 A pybind11 binding for projectaria_tools calibration submodule.
     17 """
---> 19 from _core_pybinds.calibration import *  # noqa

ImportError: libfmt.so.9: cannot open shared object file: No such file or directory

I think this issue is because I tried to install projectaria_tools inside a micromamba environment, and for some reason the pybind inside that environment is not looking for the .so files inside the environment.

I was originally using the mps_quickstart.ipynb notebook and no matter what I did with LD_LIBRARY_PATH, it wouldn't load.
export LD_LIBRARY_PATH=/samsung4tb/conda_envs/projectarea_tools_py311/lib
$ python3
Python 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:36:13) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import projectaria_tools

However it worked in command line

If you use Jupyter Notebook, be sure to use the one of your Python environments, else it will not work (since it will load different path, and so load a different python env)
See https://facebookresearch.github.io/projectaria_tools/docs/data_utilities/installation/troubleshooting#python-module-import-error
I.e When using Pixi (a package manager) you can load the notebook from the environment as
# activate the env
pixi shell
# Run Jupyter (from the env) and open the notebook (pixi, use a direct path to ensure jupyter will take the right python path)
.pixi/envs/default/bin/jupyter notebook

What I meant is did you run Jupyter Notebook from your python environment?
So let's summarize what you have encountered.

everything works if you use a classic python environment
you have the issue with libfmt only if you use micromamba

Am I right?

We got some project using projectaria_tools and using mamba (ATEK and we never saw this error before.

Wonder what the underlying issue is...

@SeaOtocinclus Thanks for your hint. Yes, previously it seems I did not start the jupyter notebook from the right python env. I did now - it doesn't work by default - but after using the LD_LIBRARY_PATH export above it also works in Jupyter Notebook.


Qualifiers and by_default

by_default lets you register an implementation to be used when no other implementation is found. But it doesn't work as expected with qualified_by.
@interface
class View(Protocol):
    name: str

@implements(View).by_default
@dataclass
class DefaultView:
    name: str = "Default View"

@implements(View).when(qualified_by=V1)
@dataclass
class CustomView:
    name: str = "Custom View"

if __name__ == "__main__":
    print(world.get[View].single(qualified_by=V1))
    print(world.get[View].single())

If I leave off .by_default it fails at lookup when discovering multiple implementations.
When I include by_default, the second print just finds CustomView again.
I have a worry that you've explained this to me in email and I forgot. 😇

Ok, I have to admit, it wasn't obvious to me either at first. :)
When doing the second part, world.get[View].single(), no constraints are used at all. So any implementation is valid, CustomView included.
What you were expecting though was an implementation without qualifiers. This can be done with a predicate constraint:
class NotQualified:
    def evaluate(self, predicate: Optional[QualifiedBy]) -> bool:
        return predicate is None

print(world.get[View].single(NotQualified()))

Also, In the V2, I intend to replace evaluate with __call__. I think it was a mistake to use a custom name. It makes using function as constraints just easier.

For the stuff I'm writing on holiday, predicates was next. So you give me a good "segue" to introduce it!

While I won't change the current behavior with qualifiers, I've added a QualifiedBy.nothing constraint:
from dataclasses import dataclass
from typing import Protocol

from antidote import implements, instanceOf, interface, QualifiedBy, world

@interface
class View(Protocol):
    name: str

@implements.protocol[View]().as_default
@dataclass
class DefaultView:
    name: str = "Default View"

@implements.protocol[View]().when(qualified_by='v1')
@dataclass
class CustomView:
    name: str = "Custom View"

if __name__ == "__main__":
    print(world[instanceOf[View]().single(qualified_by='v1')])
    print(world[instanceOf[View]().single(QualifiedBy.nothing)])

Ah, thanks, I think that covers the case (from our coding session) that my cursor is currently sitting on.
I'll close this.


Add performance testing for dfdaemon proxy

Feature request:
Registry: https://github.com/dragonflyoss/perf-tests

Use case:

UI Example:

/assign


Mounted component with import of main.js send "Cannot find element: #app"

Hello !
I have a component which import my api file.
In this API file, I import main.js to execute my mutations in my store by using vm.$store.
And now I have this warning during my tests:
[Vue warn]: Cannot find element: #app
I tried to import my store in my API file, but it's even worse, I just get a lot of errors "Cannot read property 'getters' of undefined" from getters not even in my component I want to test.
My API file looks like this :
import {instance} from '@/api/api'
import { SET_RESULTS, ERROR, SEND_QUERY } from '../../../store/modules/queries/action-types'
import vm from '@/main'

const baseRoute = '/data'

const moduleApi = {
aFunction () {
    instance().get(baseRoute)
      .then( res => {
        vm.$store.commit('SET_DATA', {res})
      })
      .catch( err => console.log(err))
  }
}

export default moduleApi

My component looks like this :
<template>

        <button @click="runMethod"/>

</template>

My main.js looks like this :
import Vue from 'vue'
import App from './App'
import router from './router'
import store from '@/store'

Vue.config.productionTip = false

export default new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',
  render: h => h(App)
})

My tests run successfully, but I want to know if there is a way to no longer have the warning about #app while running my tests.
Thank you.

try this.
// before loading main.js in your test case
Vue.config.silent = true;
document.body.innerHTML = '

';
require('main.js');

Importing the main.js inside an api service is not a great idea.. if it is the main entry of Webpack, thats even a worse idea.

Any development on this? I'm facing a similar issue here, and can't seem to find a solution.

Any development on this? I'm facing a similar issue here, and can't seem to find a solution.

could you give attachTo a go?
const div = document.createElement('div')
div.setAttribute('id', 'app')
document.body.appendChild(div)

test('whatever', () => {
  const wrapper = mount(Foo, {
    attachTo: div
  })
})

(not sure if it'll work)

could you give attachTo a go?
Hey, thanks for the reply. I tried with attachTo, but continue to receive the warning.

Can you share a minimal repro? I guess simply mounting App.vue instead of the whole Vue application would suffice?

Sure, I will make one as soon as possible.

Hey, sorry, I took longer than I expected to do this. I couldn't reproduce the error, so I'll try to explain it better. I have a component that I use for input mask in other components. I was getting several warnings that the custom directive wasn't registered, so I had to import the main.js, so I could use the global Vue, where the component was registered. With this, I stopped receiving the warnings, but now I get "Cannot find element: #app" for all tests I import main.js.
I register Vue like this
new Vue({
  router,
  i18n,
  store,
  render: (h) => h(App),

}).$mount("#app");

If the problem is a missing directive, you can customize the localVue instance to register it: https://vue-test-utils.vuejs.org/guides/#applying-global-plugins-and-mixins
import { createLocalVue, mount } from '@vue/test-utils'

const localVue = createLocalVue()

localVue.directive('my-directive', MyDirective)

mount(Component, { localVue })


Use aws_eip.default.public_ip as DNS name endpoint

what

Use aws_eip.default.public_ip as DNS name endpoint

why

by request in task https://app.asana.com/0/415062006611341/423680287658574

terraform plan:

I did the small experiment with coalesce:
variable "aws_region" {
  default = "us-central-1"
}

variable "eip" {
  default = "<IP_ADDRESS>"
}

variable "associate_public_ip_address" {
  default = false
}

resource "null_resource" "rerun" {
  triggers {
    time = "${timestamp()}"
  }
}

resource "null_resource" "eip" {
  count = "${var.associate_public_ip_address ? 1 : 0}"

  triggers {
    test = "ec2-${replace(var.eip, ".", "-")}.${var.aws_region == "us-east-1" ? "compute-1" : "${var.aws_region}.compute"}.amazonaws.com"
  }
}

output test {
  value = "${coalesce(null_resource.eip.triggers.test, var.eip)}"
}

output test1 {
  value = "${coalesce(join("", null_resource.eip.*.triggers.test), var.eip)}"
}

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

Outputs:
test1 = <IP_ADDRESS>

Tested within public access.

Tested within private access.
Instance has been created and proper private IP is being used.
Only Ansible provisioner fails, because I don't have access to private IP.


import HTTPTypesFoundation pulls in FoundationNetworking

Unfortunately, import HTTPTypesFoundation pulls in FoundationNetworking unconditionally which has issues on Linux.
We carry link-time checks to make sure that we're not accidentally using URLSession in places where it's important not to. Unfortunately, modules that import HTTPTypesFoundation now also pull in FoundationNetworking.
Would it be possible to remove the import FoundationNetworking and move that to a separate module like HTTPTypesFoundationNetworking?

Does this require a major version bump due to source breakages?

Yeah, unfortunately it does due to the leaky nature of Swift imports. In this case it a "cheap" major, and we can encourage users to depend on a cross-major range.

Yeah, unfortunately it does due to the leaky nature of Swift imports. In this case it a "cheap" major, and we can encourage users to depend on a cross-major range.

Yes, a "cheap major" is perfect here. We've done this before and asking users to do "1.0.0" ..< "3.0.0" is usually not a problem. Especially because it can be done at any point in time and doesn't break stuff either way.

I checked and URLRequest and URLResponse are both in FoundationNetworking. HTTPTypesFoundation would have no API at all if it doesn't import FoundationNetworking.
Why do these packages import HTTPTypesFoundation?

I checked and URLRequest and URLResponse are both in FoundationNetworking. HTTPTypesFoundation would have no API at all if it doesn't import FoundationNetworking.
Why do these packages import HTTPTypesFoundation?

Just for the extension HTTPRequest { public var url: URL? } :)

Oh I see

URL is part of FoundationEssentials, so that could be the only requirement there.

Alternatively, can we move extension HTTPRequest { public var url: URL? } to the main HTTPTypes package? Can we assume that FoundationEssentials exists everywhere?

Alternatively, can we move extension HTTPRequest { public var url: URL? } to the main HTTPTypes package? Can we assume that FoundationEssentials exists everywhere?

I don't think NIOExtras has FoundationEssentials, @Lukasa?

Correct, currently we don't use FoundationEssentials in NIO-world. I'm not sure how long that state of affairs will last though: the existence of FoundationEssentials relieves many of the constraints of depending on Foundation.

FoundationEssentials is present on all non-Darwin platforms as part of the Swift toolchain. On Darwin it's still just Foundation.

What's the difference between import Foundation and import FoundationEssentials on non-Darwin? Does import FoundationEssentials work on Swift 5.7 or is it more recent?

import FoundationEssentials is available in Swift 6.0 or later. See here for more information on how these are all layered.

Would you recommend that we do something like:
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

Yes that's the recommend pattern to check if it exists and import only that. IMO that's the way we should do it here and move the extension for URL to the main module of this package behind the conditional import.

Are people all OK with moving URL to the main package? I can make a new PR to do that


Missing libnode.dylib - OSX Sierra Crash on start

Hi,
Let me first thank you for the great job of making Atom, I was using it as my LaTeX editor, thus far the best.
Unfortunately, today Atom stopped working. It crashes on start. Trying to run in Safe Mode results in the same crash.
Here are the details:
The crash report indicates a dylib is missing. I was not able to find the libnode.dylib file inside the path indicated in the crash report and I could not locate it anywhere inside Atom.app. I don't understand the problem since I did not update macOS nor Atom after the last time I used Atom. Searching the web, it seems that this is a consistent issue for Atom in OSX for at least two years now, as users have being reporting this weird crash on start behavior caused by the missing lib for several OSX versions and Atom versions. In my case, Atom was working fine and I cannot identify what caused the app to stop working suddenly.

Process:               Atom [23854]
Path:                  /Applications/Atom.app/Contents/MacOS/Atom
Identifier:            com.github.atom
Version:               1.13.0 (1.13.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Atom [23854]
User ID:               501
Date/Time:             2017-01-14 12:23:00.740 -0200
OS Version:            Mac OS X 10.12.2 (16C67)
Report Version:        12
[...]
Crashed Thread:        0
Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY
Termination Reason:    DYLD, [0x1] Library missing
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: @rpath/libnode.dylib
Referenced from: /Applications/Atom.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
Reason: image not found

Does it crash every time, or occasionally?
Also, Atom updated recently, it perhaps could be a case of the auto-update process not finishing correctly.

I have the same issue - when running Atom, it just closes and not creating any logs. I tried to remove all Atom configs in my user's home directory, also tried to download and install latest Atom from the website.

Also tried 1.14.0-beta1 -- this one works

@50Wliu It crashes every time.
I downloaded Atom 1.13.0, replaced the Atom.app and now it works fine.

Thanks for the update @lfdmotta. Since this is now working for you, I'm going to close it. Let us know if you run into the problem again.


How can I decompress an LZMA compressed string?

I have some large LZMA compressed files stored on my server as assets. After downloading(using XMLHttpRequest), I need to decompress them. In my server response, I read the response as a string, but the library doesn't have an option to pass in a string for decompression. What would be the ideal way to achieve this?

I don't think reading binary data as a string is a good ideal. LZMA-JS
can read binary data straight from an Ajax request. I just added a demo
https://nmrugg.github.io/LZMA-JS/demos/ajax_demo.html to show how.
Most browsers support XMLHttpRequest2 http://caniuse.com/xhr2.
Does this solve your issue?
The reason why LZMA-JS does not support decoding strings is that they
tend to corrupt binary data. If you really want to use a string, you
should be able to loop through the string calling .charCodeAt() to
create a byte array manually.

Yes, this works!
Thanks!
I do not know if it was a result of the LZMA decompression, but an extra
whitespace char got added to the beginning of the decompressed string. As a
result, I was not able to parse the extracted string unless I did a trim()
on the string first(it was compressed XML data). Everything worked well
after that.
On Thu, Apr 23, 2015 at 10:27 PM, Nathan Rugg<EMAIL_ADDRESS>wrote:

I don't think reading binary data as a string is a good ideal. LZMA-JS
can read binary data straight from an Ajax request. I just added a demo
https://nmrugg.github.io/LZMA-JS/demos/ajax_demo.html to show how.
Most browsers support XMLHttpRequest2 http://caniuse.com/xhr2.
Does this solve your issue?
The reason why LZMA-JS does not support decoding strings is that they
tend to corrupt binary data. If you really want to use a string, you
should be able to loop through the string calling .charCodeAt() to
create a byte array manually.
—
Reply to this email directly or view it on GitHub
https://github.com/nmrugg/LZMA-JS/issues/16#issuecomment-95652888.

--
Vinay S Shenoy
Software Developer, VR at Stealth Startup
+91-9538122356 |<EMAIL_ADDRESS>LinkedIn : http://in.linkedin.com/in/vinaysshenoy

Cool. I'll close this then.


Fix for Registry 3399: Malfunction on likes and dislikes counting

In this PR:

Get total likes(:thumbsup:) and dislikes (:thumbsdown:) count from SOCIAL_LIKES table instead of embedding those values to activity body
Move is iLike(:blush:) and iDislike(:disappointed:) checks to listActivities method in SQLActivityBrowser
Update isReviewed method to check both comments and likes activities, and rename the method as isPublished

Address the following issue : REGISTRY-3399

There seems to be a few formatting issues in the Java files.


Any idea on how to make ESL100CW work?

Hi,
This is not an issue with the library but I'd appreciate any input! I've been trying to figure out how to make the "Tunable" bulb to work with no luck. All the SmartBulb/ APIs work except for the /devicestatus. When I try to PUT the new status it hangs for a while then I get an error message that "the device is not responding" (according to Google translate). POST just causes an "internal module error"
I also tried to use all the other APIs for all other devices that I could find in this library and by inspecting the app, none of them worked. It seems I'm missing something stupidly simple.
This is the request that hangs: (omitting all headers):
PUT https://smartapi.vesync.com/SmartBulb/v1/device/devicestatus
{
  "timeZone":"America/New_York",
  "acceptLanguage":"en",
  "accountID":"XXXXXXX",
  "token":"XXXXXXXXXXXXX",
  "uuid":"XXXXXXXXXXXXX",
  "status":"on",
  "brightness":"100"
}

The response:
{
  "code": 4041005,
  "msg": "设备未响应",
  "traceId": "1565073187628",
  "result": null
}

For more information about the device, this is an excerpt of what I get when I POST https://smartapi.vesync.com/cloud/v1/deviceManaged/devices
 {
      "deviceRegion": "US",
      "deviceName": "Bedroom",
      "deviceImg": "https://smartapi.vesync.com/v1/app/imgs/icon_dimmable_bulb/icon_white_light_bulb.png",
      "cid": "XXXXXXXXXXXXXXXXXXXXX",
      "deviceStatus": "off",
      "connectionStatus": "online",
      "connectionType": "wifi",
      "deviceType": "ESL100CW",
      "type": "Wifi-light",
      "uuid": "XXXXXXXXXXXXXXXXXXXXXX",
      "configModule": "WiFi_Bulb_WhiteLightBulb_US",
      "macID": null,
      "mode": null,
      "speed": null,
      "extension": null,
      "currentFirmVersion": null,
      "subDeviceNo": null
    }]

Any ideas?
Thanks!

Your hitting the /SmartBulb/ endpoint which is only for the ESL100.  Each device has it's own endpoint.  You can try different combinations, such as /TunableBulb/, /CTWLBulb/, etc. but you would also have to figure out the call structures by trial and error.  The best way would be to load the VeSync App up on an Android device or Android Emulator and use a packet capturing app to catch the traffic.  I have had success with this one (no root required)
https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture&hl=en_US
Just start capturing for the VeSync app, load the device list and try using all of the controls for that bulb.  You can paste the results here and I'll see if I can add it into this library.

Thanks Joe! I tried all of routes with the expected payload that I found in the app (it's just a ReactNative JS file) I wasn't blindly going over them :) But here's the thing, using the Packet Capture tool I was able to find out where I went wrong with the route that was supposed to work. I missed part of the payload. Thank you for referring me to that tool I didn't know we could capture SSL without root.
Yislamo!

Glad I can help, if you want to post those calls I will work on integrating it into this library

Sure. Here you go:
POST https://smartapi.vesync.com/cloud/v1/deviceManaged/bypass
{
  "acceptLanguage": "en",
  "accountID": "XXXXXX",
  "appVersion": "2.8.4",
  "timeZone": "America/Los_Angeles",
  "token": "XXXXXXXXXX",
  "uuid": "XXXXXXXXXX",
  "cid": "XXXXXXXXXXX",
  "configModule": "WiFi_Bulb_WhiteLightBulb_US",
  "jsonCmd": {
    "light": {
      "action": "off"
    }
  },
  "method": "bypass",
  "traceId": "--------------",
  "phoneBrand": "SomePhone",
  "phoneOS": "Android 8.0.0"
}


acs-engine docker image broken

@CecileRobertMichon Unfortunately, the currently published Docker image doesn't seem to be correctly formed: it's has a windows binary on a Linux base, and doesn't seem to use the Dockerfile in the repo.
There are instructions on how to build the image in the releases directory:
https://github.com/Azure/acs-engine/blob/master/releases/README.Dockerfile.md
Is seems like you're using Windows, based on the Docker image that was published, so the commands to run are probably as follows (I don't have a Windows machine available at the moment to verify):
PS> cd releases
PS> $VERSION="0.19.1"
PS> docker build --no-cache --build-arg BUILD_DATE=$(Get-Date((Get-Date).ToUniversalTime()) -UFormat "%Y-%m-%dT%H:%M:%SZ") --build-arg ACSENGINE_VERSION="$VERSION" -t microsoft/acs-engine:$VERSION --file .\Dockerfile.linux .
PS> docker push "microsoft/acs-engine:$VERSION"

Ah, I see what you mean
PS> docker run -it microsoft/acs-engine:v0.19.1 sh
# pwd
/gopath/src/github.com/Azure/acs-engine
# ls bin
acs-engine.exe

Unfortunately I can't fix this today, hopefully we can pick it up tomorrow.

@apeschel just pushed an updated image, please let me know if it works for you. You should be able to run ```PS> $VERSION="0.19.1"
PS> docker pull "microsoft/acs-engine:$VERSION"
PS> docker run -it microsoft/acs-engine:0.19.1````

@CecileRobertMichon Tried it out and can confirm it looks good, thanks for the help!

Great, I realized I used the wrong Dockerfile the first time...


On mobile the "back" button shows old Overlay running.

AFAIK this must be a cache problem with the mobile browser, but maybe we together can find a way to solve this.
SITUATION
I am on the starting page of my website and when i click for example on the "About me" link to get to that sub-page, i activate a  full screen Overlay. Obviously as soon as the new page (about me) appears, the Overlay is gone as a whole new HTML is loaded.
PROBLEM
On my mobile phone: I do the above and once i am on the "About me" page i hit the "back" button of the phone, to get back to the starting page. But as the "old" page is showing, the Overlay still is active.
WORKAROUND
First i did a simple timeout of 4 seconds. This means: the new page is loaded and if i hit the back button a couple of seconds later, the overlay is gone. The problem here is that on a slow internet connection, 4 seconds might not be enough. So the Overlay might disappear, thus the user still being on the starting page.
QUESTION
Could there be a solution that triggers right before the page is "unloaded". So we could say that "before the new page is loaded, first remove the overlay" ?
Just some idea. I am working with Winter CMS and there are some Init, Right after, Rigth before and Re-Init options via PHP but this looks too heavy for me. The idea here would be to make the PHP Init check if an overlay exists, and if it does, then remove it. but i would prefer to make it with JS or Jquery.
Any ideas anyone? Greetings from this corner of the planet.

Hi!
Just to be 100% sure, are you loading the pages using a pure ajax approach? Since this is a jQuery plugin, it makes sense if all the interactions are actually performed in JS.
I would show the LoadingOverlay, request the next page contents through an ajax call, replace the contents of the page (maybe a <main> element) and then hiding the LoadingOverlay. You have to be in control of it.
About the back button, you can attach an handler to window's popstate event and use JS History API to manipulate it and override default back button behaviour (IE: history.replaceState("", null, " ");)
I have never worked with Winter CMS and have no idea about it, so I cannot help you with it, sorry.

Your suggestion is totally correct, but I also apparently just found another solution via jQuery by checking the available event listeners of a website and this is what i came up with...
window.addEventListener( "pageshow", function ( event ) {     $.LoadingOverlay("hide"); });
This means that every time the page is shown, that the overlay is going to be hidden, even if it works in the background.


Performance of the Seq appender

Nick,
Members of my team are starting to doubt that logging to Seq is for free or close to it, meaning that there is no overhead occurring. More important is that logging to Seq should be async and not hold up process of the main thread.  Are there tests that exemplify these "features" that I can use to prove to the team of the robustness of the Serilog/Seq story?
Thank you,
Stephen

Hi Stephen! Thanks for getting in touch.
Logging to Seq isn't free overall - the app needs to construct LogEvents, capture properties, serialize JSON and (in batches) send HTTP requests to get events from the app into Seq. It's still very fast, but if you create enough events or serialize enough data then you'll see a corresponding consumption of resources.
The work is split between the application thread and a background thread, though, so apart from capturing of the log data, which happens during the call to Log.Information() (or error, etc.), most of this work happens in the background.
The code responsible for this actually lives in https://github.com/serilog/serilog-sinks-periodicbatching, and is shared by the Seq sink and many others.
The trick to demonstrating this, I think, is to run a console app that writes to an imaginary Seq server:
Serilog.Debugging.SelfLog.Enable(Console.Out);

Log.Logger = new LoggerConfiguration()
    .WriteTo.Seq("http://seq.example.com")
    .CreateLogger();

Console.WriteLine("Before logging call");

Log.Information("Hello, Seq!");

Console.WriteLine("After logging call");

Log.CloseAndFlush();

You'll see the two console writes immediately, and the connection error printed afterwards, demonstrating how the call is being made concurrently with the app code. (Unless your network stack is super fast ;-).
Hope this helps!

Works like a champ! Thanks Nick!