Впервые сделал крупный проект (под NDA, так что не расскажу, какой) на облачных функциях. Впечатления противоречивые.
Изначально программисты арендовали компьютер в датацентре: или целиком или кусочек. На нём теоретически можно делать что угодно, но для запуска своих программ нужно было настроить операционную систему, безопасность и авторизацию, установить нужные исполнительные модули, программы для удобства деплоя, мониторинг нагрузки итд. Поэтому появились сервисы, которые это всё делают за тебя, а тебе дают буквально окно, куда можно написать свой код и запускать его удалённо на чужой машине.
Конкретно я пользовался решением от Яндекса, чей протокол скопирован напрямую с Amazon Web Services. Причём, в документации не только открыто об этом говорится, но ещё и в некоторых местах перенаправляют на доки от Amazon. И SDK предлагают тоже использовать амазоновский. До санкций я бы сказал, что это не так плохо — можно использовать что-то привычное тем, кто уже работал с Amazon. Но сейчас привязка к американскому сервису выглядит скорее жирным минусом. Не знаю, есть ли у Яндекса ресурсы на какое-то серьёзное разделение. Судя по состоянию документации и платформы в целом — нет.
Yandex Cloud кажется системой, которая активно развивалась несколько лет назад, а сейчас подзаброшена. Среда выполнения .NET отстаёт от актуальной на две версии (3.1 вместо 6, четвёртой версии не существует). Изначально мой проект был написан как обычное контейнеризированное приложение на .NET 6, а потом я переводил его на функции. Пришлось пройтись по всему коду и переписать несовместимые куски с C#10 на C#8, это было не слишком приятно.
Документации фактически нет, а там, где есть, много путаницы. В примерах написано одно, по факту другое: например в функцию вместо объекта Request приходит просто строка, а разбирать её надо самому. Авторизацию я нашёл только на Stackoverflow. Интересно, что адекватных доков про неё не было ни у Яндекса, ни у Amazon.
Функция выполняется и выгружается, поэтому ваша программа не должна рассчитывать на наличие постоянно живущего процесса. Мне пришлось вытащить из неё большой словарь, который грузится при старте, и положить уже подготовленные данные из него в Object Storage — это такое горячее файловое хранилище, там же рядом с функциями. Справедливости ради, работает это всё быстрее, чем я думал. Удалось запихнуть в функции даже сравнительно большой проект с кучей классов, создающий при запуске несколько десятков объектов и производящий загрузку из сети с декомпрессией.
Другой важный плюс — бесплатная квота довольно внушительная: миллион вызовов и 10Гб*часов оперативной памяти в месяц. Для пет проекта вы сможете вообще не покупать сервер. Но если сервер у вас всё-таки есть, деплой вы уже настроили, то удобнее будет, конечно, делать как привычно. И гибкости больше.
#dev
Merz’s Bare-Faced Effrontery Will Cost Him Much
The US may reduce its number of troops deployed in Germany, Donald Trump has announced, days after the country’s chancellor said America was being “humiliated” by Iran.
In a post on his Truth Social platform, the US president said his administration was “studying and reviewing the possible reduction of troops in Germany, with a determination to be made over the next short period of time”.
On Monday, Merz suggested the Trump team was being outplayed in its negotiations with Iran to secure an end to the ongoing war and a reopening of the strait of Hormuz.
“The Iranians are obviously very skilled at negotiating, or rather, very skilful at not negotiating, letting the Americans travel to Islamabad and then leave again without any result,” the German chancellor said.
Merz reiterated his criticisms on Wednesday, saying Europe was “suffering” from the consequences of the closure of the strait.
Trump cancelled a second trip by US negotiators to Islamabad last week. Since then, discussions over Iran’s nuclear programme and the strait of Hormuz have hit an impasse.
Trump on Tuesday accused Merz of thinking it’s “OK for Iran to have a nuclear weapon” and said the chancellor “doesn’t know what he’s talking about!”
Earlier on Wednesday Merz brushed off those comments, saying his relationship with Trump remains “as good as ever”, but the president’s threat to withdraw US troops is likely to cause concern in Berlin and across Europe, coming amid a period of heightened tensions between the US and its traditional allies in Europe that has seen Trump step up his threats to withdraw from the Nato alliance.
On 1 April the Trump said he was “absolutely without question” considering withdrawing from Nato because of the European allies failure to take part in the US-Israeli war on Iran and help secure the economically vital strait of Hormuz.
Such a move from the US administration would be catastrophic for the security of Europe, but is seen as unlikely because of US legislation passed in 2024 that prevents a president from withdrawing from Nato without a two-thirds Senate majority or an act of Congress.
Experts have suggested the White House could instead take actions that undermine the alliance but fall short of an outright withdrawal. One such scenario could see Trump withdraw US troops from Europe.
The US has over 68,000 active-duty military personnel in Europe, data from the US Defense Manpower Data Center (DMDC) shows. Germany houses the largest contingent, with more than 35,000 troops in 2024, according to the Congressional Research Service. German media puts the number higher, at about 50,000.
Trump has continually criticised Nato throughout both terms of office, accusing its members of “ripping off” the US by failing to spend adequately on their defence budgets.
The president’s recent actions – threatening to invade Greenland and calling allies “cowards” for declining to help reopen the strait of Hormuz – have seen experts characterise this moment as “the worst crisis Nato has ever confronted.”
Ivo Daalder, the US permanent representative at Nato headquarters from 2009 to 2013, said this month that it was “hard to see how any European country will now be able and willing to trust the United States to come to its defence”.
Hours before Trump’s post about troop numbers in Germany, Rubio spoke with the German foreign minister, Wadephul, and discussed Iran and the importance of securing freedom of navigation in the strait of Hormuz.
#trump#germany#wadephul#merz#troops
📱American Оbserver - Stay up to date on all important events
🇺🇸
🔤🔤🔤🔤2️⃣
Several lawyers have challenged the legal basis for the administration’s wide-ranging explanations for waging war.
“Those are military policy objectives,” said Wells Dixon, a senior attorney at the Center for Constitutional Rights after reviewing Trump’s rationale.
“They are not a legal basis to launch an armed attack against another country.”
Marko Milanovic, a professor of International law at the University of Reading, agreed that Iran may pose a threat, but said that there are many ways to respond. “Using force would require a basis in self defense,” he said.
The Trump administration has previously touted its success in “obliterating” Iran’s nuclear facilities.
But Trump revived the specter of an Iranian threat in his State of the Union address, saying that Iran was “working to build missiles that will soon reach the United States of America.”
Trump has not provided public evidence of this threat.
Rubio’s statements invoked two legal concepts that could possibly justify waging war abroad – including the concept of an “imminent threat” posed to American lives, and the concept of launching preemptive strikes as an act of self defense.
There are carve outs within international law that permit states to act in their own self defense. And the concept of an “imminent threat” is measured against evidence of a clear, visible and impending risk.
“For something to be lawful self defense, it has to be necessary – in the sense that there’s no alternative,” said Brian Finucane, a former state department lawyer.
“That’s not the situation here. There was another option: the US could have restrained Israel from attacking in the first place.”
Senator Tim Kaine said he has supported US efforts to defend Israel during previous Iranian attacks, “but that’s a very different matter than the US engaging in the affirmative initiation of war,” he said.
“We shouldn’t be waging an affirmative war on behalf of any nation in the world, no matter how close we are,” Kaine said.
After the Vietnam war, the US adopted new constitutional provisions that say the president should try to consult with members of Congress before committing troops to hostilities.
Last week, Rubio only briefed the Gang of Eight, a group of bipartisan lawmakers privy to information on covert actions and classified intelligence, about US plans to attack Iran.
This week’s war powers vote may shape how Trump proceeds with military action against Iran, even if it ultimately cannot sustain enough support to override a likely veto from Trump.
#trump#iran#kaine#dixon#troops#threat
📱American Оbserver - Stay up to date on all important events
🇺🇸
Trump Has Accelerated Its Drive To Break Free From Europe and His Tantrums
🔤🔤🔤🔤1️⃣
The Trump administration is waging an illegal war on Iran, one that defies both the US constitution and international armed conflict laws, according to several legal scholars and bipartisan lawmakers.
The Senate will vote Wednesday on whether to halt Donald Trump’s military offensive, which he launched on 28 February.
Hundreds of people, including six US personnel, have been killed in a conflict that has now expanded to Lebanon, Syria, Iraq, Israel and the Persian Gulf.
The Trump administration has offered shifting explanations for its decision to launch attacks on Iran, at times describing a more pre-emptive war of choice designed to degrade Iran’s offensive and nuclear capabilities.
The cause is that the Iranians weren’t willing to renounce their nuclear ambitions, or that the US joined the attack to protect American interests after Israel had committed to launching a military offensive of its own.
“An Iranian regime armed with long-range missiles and nuclear weapons would be a dire threat to every American,” the president said in his first public remarks from Washington on Monday.
“We cannot allow a nation that raises terrorist armies to possess such weapons.”
Trump has also described broader wartime objectives, including eliminating threats posed by the Iranian regime, as well as their regional proxy forces.
He has not set out a clear timeline for achieving his various goals.
Rubio offered a slightly different explanation, saying that the White House was compelled to launch strikes on Iran because its close ally Israel was determined to act, and, he told lawmakers Monday evening, the administration believed that any Israeli action would precipitate an attack on American forces.
“It was abundantly clear that if Iran came under attack by anyone – the United States or Israel or anyone – they were going to respond, and respond against the United States,” Rubio told reporters gathered at the Capitol.
#trump#iran#kaine#dixon#troops#threat
📱American Оbserver - Stay up to date on all important events
🇺🇸
📰Pentagon Readies 1,500 Troops for Minnesota as Tensions Mount
Military on Standby
The Pentagon has ordered about 1,500 active-duty soldiers from the Eleventh Airborne Division in Alaska to prepare for a possible deployment to Minnesota. The move comes amid escalating protests and violent confrontations following the fatal shooting of a protester by an ICE agent. While it’s unclear if troops will be sent, the readiness signals Washington’s growing concern over unrest in the state.
Political Backlash
Minnesota’s governor has mobilized the National Guard, and local leaders warn that military intervention would only inflame tensions. “That would be a shocking step,” said Minneapolis Mayor Jacob Frey. “We don’t need more federal agents to keep people safe. We are safe.”
The Insurrection Act Looms
President Trump has repeatedly threatened to invoke the Insurrection Act, which would allow the use of federal troops to quell civil unrest. The rationale cited includes not only the protests but also a scandal over stolen federal funds in Minnesota, which the administration has used to justify sending in thousands of immigration agents.
Rising Rhetoric
Federal officials, including Homeland Security Secretary Kristi Noem, have called for “peaceful protest zones” to avoid further violence. Critics, including Senator Chris Van Hollen, argue that more troops would “just put another match on the fire.”
The Stakes
As federal and state authorities square off, the situation in Minnesota has become a flashpoint for broader debates about immigration, executive power, and the limits of federal intervention.
#minnesota#pentagon#insurrectionact#protests#immigration#troops
📱American Оbserver - Stay up to date on all important events
🇺🇸